DevExtreme jQuery - ODataStore Methods
byKey(key)
A Promise that is resolved after the data item is loaded. It is a native Promise or a jQuery.Promise when you use jQuery.
byKey(key, extraOptions)
A Promise that is resolved after the entity is loaded. It is a native Promise or a jQuery.Promise when you use jQuery.
In the following code, the byKey method loads the product with ID 1
along with the "Category"
navigation property:
- var store = new DevExpress.data.ODataStore({
- // ...
- key: "Product_ID"
- });
- store.byKey(1, { expand: "Category" })
- .done(function (dataItem) {
- // Process the "dataItem" here
- })
- .fail(function (error) {
- // Handle the "error" here
- });
createQuery(loadOptions)
An object containing the expand, requireTotalCount, and customQueryParams properties.
- var store = new DevExpress.data.ODataStore({
- // ODataStore is configured here
- });
- var query = store.createQuery({ expand: "propertyName" });
See Also
insert(values)
A Promise that is resolved after the data item is added. It is a native Promise or a jQuery.Promise when you use jQuery.
- var store = new DevExpress.data.ODataStore({
- // ODataStore is configured here
- });
- store.insert({ id: 1, name: "John Doe" })
- .done(function (dataItem, key) {
- // Process the "key" and "dataItem" here
- })
- .fail(function (error) {
- // Handle the "error" here
- });
load()
A Promise that is resolved after data is loaded. It is a native Promise or a jQuery.Promise when you use jQuery.
load(options)
A Promise that is resolved after data is loaded. It is a native Promise or a jQuery.Promise when you use jQuery.
remove(key)
A Promise that is resolved after the data item is removed. It is a native Promise or a jQuery.Promise when you use jQuery.
totalCount(options)
Gets the total count of items the load() function returns.
A Promise that is resolved after the total item count is obtained. It is a native Promise or a jQuery.Promise when you use jQuery.
update(key, values)
A Promise that is resolved after the data item is updated. It is a native Promise or a jQuery.Promise when you use jQuery.
If you have technical questions, please create a support ticket in the DevExpress Support Center.