PivotGridDataSource Configuration

This section describes the configuration options of the PivotGridDataSource object.

NOTE: To create a PivotGridDataSource instance that uses custom data access logic, pass the CustomStore configuration object to the PivotGridDataSource constructor as shown below.

JavaScript
var myPivotGridDataSource = new DevExpress.data.PivotGridDataSource({
    load: function(loadOptions) {
        // data loading logic
    },
    byKey: function(key) {
        // data access by key logic
    }
});

fields[]

An array of pivot grid fields.

Type: Array
Default Value: undefined

If the store type you use is not XmlaStore, you need to describe data from the data source for dxPivotGrid by assigning a list of fields to this option. Each pivot grid field must be associated with the field in the store using the dataField option.

Fields can be instantly placed into the pivot grid by assigning a value to the area option. If this option is undefined, the field will be displayed in the Field Chooser only.

NOTE: If this array is not specified and the retrieveFields option is set to true, the fields will be generated automatically and placed to the Field Chooser.

filter

Specifies data filtering conditions.

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

localSorting

Indicates whether or not the local sorting of the XMLA data should be performed.

Type: Boolean
Default Value: false

Set this value to true if local sorting is more applicable for your task than OLAP server sorting.

onChanged

A handler for the changed event.

Type: function

Assign a function to perform a custom action after data is successfully loaded or reloaded.

onFieldsPrepared

A handler for the fieldsPrepared event.

Type: function
Function parameters:
fields: Array
An array of fields.

Assign a function to perform a custom action when all fields are loaded from the Store and prepared to be displayed in the dxPivotGrid.

onLoadError

A handler for the loadError event.

Type: function
Function parameters:
error: Object
An object defining the occurred error.

Assign a function to perform a custom action when data loading fails.

onLoadingChanged

A handler for the loadingChanged event.

Type: function
Function parameters:
isLoading: Boolean
Indicates if data is being loaded.

Assign a function to perform a custom action when the data loading status is changed.

retrieveFields

Indicates whether or not the automatic field generation from data in the Store is enabled.

Type: Boolean
Default Value: true

With this option enabled, the automatically generated fields will be available in the Field Chooser.

If you disable this option, the PivotGrid will contain only those fields that are configured in the fields array.

store

Specifies the underlying Store instance used to access data.

You can assign any Store instance, an XmlaStore instance or an array to this option. If you assign an array, the ArrayStore will automatically be created within the PivotGridDataSource internally.