DataSource Configuration

This section describes configuration options used to configure the data source.

filter

Specifies data filtering conditions.

For information on filter expressions, refer to the Filtering section of the Data Layer article.

group

Specifies data grouping conditions.

For information on group expressions, refer to the Grouping section of the Data Layer article.

map

The item mapping function.

Type: function
Function parameters:
dataItem: Object
The data item to be processed.
Return Value: Object
The processed data item.

For more information on item mapping, refer to the Item Mapping section of the Data Layer article.

pageSize

Specifies the maximum number of items the page can contain.

Type: Number
Default Value: 20

paginate

Specifies whether DataSource loads data by pages, or all items at once.

Type: Boolean
Default Value: false if grouped, true otherwise

postProcess

The data post processing function.

Type: function
Function parameters:
data: Array
The data array to be processed.
Return Value: Array
The processed data array.

For more information on post processing, refer to the Post Processing section of the Data Layer article.

searchExpr

Specifies a value by which the required items are searched.

Type: getter

In most cases, you should pass the name of a field by whose value data items are searched. If you need to search elements by several field values, assign an array of field names to this option.

JavaScript
var dataSource = new DevExpress.data.DataSource({
    store: myStore,
    searchExpr: ["firstName", "lastName"]
});

For more information on searching, refer to the Search Api section of the Data Layer article. For information on getters, refer to the Getters and Setters section of the Data Layer article.

searchOperation

Specifies the comparison operation used to search for the required items.

Type: String
Default Value: "contains"

The option supports the following values: "=", "<>", ">", ">=", "<", "<=", "startswith", "endswith", "contains", "notcontains".

For more information on searching, refer to the Search Api section of the Data Layer article.

searchValue

Specifies the value to which the search expression is compared.

Type: Object
Default Value: null

For more information on searching, refer to the Search Api section of the Data Layer article. For information on getters, refer to the Getters and Setters section of the Data Layer article.

select

Specifies the initial select option value.

For information on select expressions, refer to the Select Expressions section of the Data Layer article.

sort

Specifies the initial sort option value.

For information on sort expressions, refer to the Sorting section of the Data Layer article.

store

Specifies the underlying Store instance.

Type: Store|Array

You can also assign an array to this option. In this case, the ArrayStore will automatically be created within the DataSource.