cancel(operationId)
You can use the operationId field that extends the Promise object returned from the load() and reload() methods to access the operation identifier.
- var ds = new DevExpress.data.DataSource({
- // DataSource is configured here
- });
- var loadPromise = ds.load();
- loadPromise.done(function (result) {
- // ...
- });
- ds.cancel(loadPromise.operationId);
filter()
Gets the filter property's value.
- var ds = new DevExpress.data.DataSource({
- // ...
- filter: ["age", ">", 18]
- });
- var filterExpr = ds.filter(); // returns ["age", ">", 18]
See Also
group()
Gets the group property's value.
- var ds = new DevExpress.data.DataSource({
- // ...
- group: { selector: "employeeID", desc: true }
- });
- var groupExpr = ds.group(); // returns { selector: "employeeID", desc: true }
See Also
isLastPage()
Checks whether the count of items on the current page is less than the pageSize. Takes effect only with enabled paging.
key()
- var ds = new DevExpress.data.DataSource({
- store: {
- // ...
- key: "ProductID"
- }
- });
- var keyProps = ds.key(); // returns "ProductID"
See Also
- key in ArrayStore | CustomStore | LocalStore | ODataStore
load()
A Promise that is resolved after data is loaded. It is a native Promise or a jQuery.Promise when you use jQuery.
- var ds = new DevExpress.data.DataSource({
- // DataSource is configured here
- });
- ds.load()
- .done(function (data) {
- // Process "data" here
- })
- .fail(function (error) {
- // Handle the "error" here
- });
The Promise returned from this method is extended with the operationId field which you can use to cancel the invoked operation. See cancel(operationId) for details.
See Also
loadOptions()
- var ds = new DevExpress.data.DataSource({
- // DataSource is configured here
- });
- var loadOptions = ds.loadOptions();
on(eventName, eventHandler)
Use this method to subscribe to one of the events listed in the Events section.
See Also
on(events)
Use this method to subscribe to several events with one method call. Available events are listed in the Events section.
See Also
pageIndex(newIndex)
Sets the index of the page that should be loaded on the next load() method call.
Call the load() method to update the UI component bound to the DataSource:
- var ds = new DevExpress.data.DataSource({
- // ...
- paginate: true,
- pageSize: 10
- });
- ds.pageIndex(2);
- ds.load();
pageSize(value)
Sets the page size.
Call the load() method to update the UI component bound to the DataSource:
- var ds = new DevExpress.data.DataSource({
- // ...
- paginate: true,
- pageSize: 10
- });
- ds.pageSize(15);
- ds.load();
paginate(value)
Sets the paginate property's value.
Call the load() method to update the UI component bound to the DataSource:
- var ds = new DevExpress.data.DataSource({
- // ...
- paginate: true,
- pageSize: 10
- });
- ds.paginate(false);
- ds.load();
reload()
Clears currently loaded DataSource items and calls the load() method.
A Promise that is resolved after loading is completed and rejected after loading failed. It is a native Promise or a jQuery.Promise when you use jQuery.
DataSource reloads data starting from the current page index. To reload all data, set pageIndex to 0
before you call reload().
The Promise returned from this method is extended with the operationId field which you can use to cancel the invoked operation. See cancel(operationId) for details.
requireTotalCount(value)
Sets the requireTotalCount property's value.
Call the load() method to update the UI component bound to the DataSource:
- var ds = new DevExpress.data.DataSource({
- // ...
- requireTotalCount: true
- });
- ds.requireTotalCount(false);
- ds.load();
searchExpr()
Gets the searchExpr property's value.
The property's value; described in the Getters and Setters section.
searchExpr(expr)
Sets the searchExpr property's value.
A new value; described in the Getters and Setters section.
searchValue(value)
Sets the searchValue property's value.
Call the load() method to update the UI component bound to the DataSource:
- var ds = new DevExpress.data.DataSource({
- // DataSource is configured here
- });
- ds.searchExpr("firstName");
- ds.searchOperation("contains");
- ds.searchValue("Jo");
- ds.load();
See Also
select(expr)
Sets the select property's value.
- var ds = new DevExpress.data.DataSource({
- // DataSource is configured here
- });
- ds.select(["firstName", "lastName", "birthDate"]);
- // or
- // ds.select("firstName", "lastName", "birthDate");
See Also
totalCount()
Gets the number of data items in the store after the last load() operation without paging. Takes effect only if requireTotalCount is true
If you have technical questions, please create a support ticket in the DevExpress Support Center.