DevExtreme React - DataSource Props
The DataSource allows specifying CustomStore options in its configuration object, as shown in the following code:
customQueryParams
Custom parameters that should be passed to an OData service with the load query. Available only for the ODataStore.
expand
Specifies the navigation properties to be loaded with the OData entity. Available only for the ODataStore.
filter
Possible variants:
Binary filter
- [ "field", "=", 3 ]
Unary filter
- [ "!", [ "field", "=", 3 ] ]
Complex filter
- [
- [ "field", "=", 10 ],
- "and",
- [
- [ "otherField", "<", 3 ],
- "or",
- [ "otherField", ">", 11 ]
- ]
- ]
See Also
group
This option accepts one of the following:
String
The field name to group by.Object
An object with the following fields:- selector: String
The field name to group by. - desc: Boolean
Sorts the selector field in descending order.
- selector: String
Array
An array of strings and objects described above.Function
A function implementing custom grouping logic.
See Also
pageSize
Specifies the maximum number of data items per page. Applies only if paginate is true.
paginate
Specifies whether the DataSource loads data items by pages or all at once. Defaults to false if group is set; otherwise, true.
requireTotalCount
If this option is set to true, the Promise that the load() method returns is resolved with a second argument that contains the totalCount field:
- var ds = new DevExpress.data.DataSource({
- // ...
- requireTotalCount: true
- });
- ds.load()
- .done(function (data, extra) {
- // "data" contains the loaded data
- // "extra" contains the "totalCount" field
- });
searchExpr
In most cases, you should pass the name of a field by whose value data items are searched. Assign an array of field names to this option if you need to search elements by several field values.
You can use this option along with searchOperation and searchValue to specify a simple filter. Use the filter option for more complex filtering conditions. Filters are combined if you specify them in both ways.
See Also
searchOperation
Specifies the comparison operation used in searching. The following values are accepted: "=", "<>", ">", ">=", "<", "<=", "startswith", "endswith", "contains", "notcontains".
You can use this option with searchExpr and searchValue to specify a simple filter. Use the filter option for more complex filtering conditions. Filters are combined if you specify them in both ways.
In an ASP.NET MVC Control, specify this option using the FilterOperations
enum that accepts the following values: Equal
, NotEqual
, LessThan
, LessThanOrEqual
, GreaterThan
, GreaterThanOrEqual
, NotContains
, Contains
, StartsWith
, EndsWith
and Between
.
See Also
searchValue
You can use this option along with searchExpr and searchOperation to specify a simple filter. Use the filter option for more complex filtering conditions. Filters are combined if you specify them in both ways.
See Also
select
This option accepts one of the following:
String
A field name to select.Array of strings
Several field names to select.Function
A function implementing custom selection logic.
See Also
sort
This option accepts one of the following:
String
The field name to sort by.Object
An object with the following fields:- selector: String
The field name to sort by. - desc: Boolean
Sorts the selector field in descending order.
- selector: String
Array
An array of strings and objects described above.Function
A function implementing custom sorting logic.
See Also
store
This option accepts one of the following:
Store instance
An ArrayStore, LocalStore, ODataStore, or CustomStore instance.Store configuration object
An ArrayStore, LocalStore, or ODataStore configuration object. Make sure to set the type option.Array
Assigning an array to the store option automatically creates an ArrayStore in the DataSource.
If you have technical questions, please create a support ticket in the DevExpress Support Center.