-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# DevExtreme | ||
|
||
DevExtreme (by DevExpress) supports OData as a [data source](https://js.devexpress.com/Documentation/Guide/Data_Binding/Specify_a_Data_Source/OData/). | ||
However, it supports only OData 4.0, not OData 4.01. To support Lodata you must send the "OData-Version" header with every request. | ||
|
||
Alternatively, you can configure Lodata to default to OData 4.0 if the client does not specify a version by modifying the | ||
[configuration](/getting-started/configuration.md) | ||
|
||
This Vue example shows how to send the header, and load data into a DxDataGrid. | ||
|
||
```vue | ||
<template> | ||
<DxDataGrid | ||
:data-source="dataSource" | ||
:show-borders="true" | ||
> | ||
<DxColumn data-field="id"/> | ||
<DxColumn data-field="name"/> | ||
<DxColumn data-field="email"/> | ||
</DxDataGrid> | ||
</template> | ||
<script> | ||
import 'devextreme/data/odata/store'; | ||
import { DxDataGrid, DxColumn } from 'devextreme-vue/data-grid'; | ||
export default { | ||
components: { | ||
DxDataGrid, | ||
DxColumn, | ||
}, | ||
data() { | ||
return { | ||
dataSource: { | ||
store: { | ||
type: 'odata', | ||
url: 'http://localhost:8000/odata/Users', | ||
beforeSend: function (e) { | ||
e.headers = { | ||
'OData-Version': '4.0' | ||
}; | ||
}, | ||
key: 'id', | ||
version: 4 | ||
}, | ||
select: [ | ||
'id', | ||
'name', | ||
'email' | ||
] | ||
}, | ||
}; | ||
}, | ||
}; | ||
</script> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/__snapshots__/Protocol/VersionTest__test_config_default_version__1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"headers": { | ||
"cache-control": [ | ||
"no-cache, private" | ||
], | ||
"content-type": [ | ||
"application/json;odata.metadata=minimal" | ||
], | ||
"odata-version": [ | ||
"4.0" | ||
] | ||
}, | ||
"status": 200 | ||
} |