A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://js.devexpress.com/Documentation/ApiReference/Data_Layer/PivotGridDataSource/ below:

DevExtreme jQuery - PivotGridDataSource API

The PivotGridDataSource is an object that provides an API for processing data from an underlying store. This object is used in the PivotGrid UI component.

jQuery
$(function() {
    var pivotGridDataSource = new DevExpress.data.PivotGridDataSource({
        store: {
            // ...
            // Underlying store is configured here
            // ...
        },
        fields: [{
            area: "column",
            dataField: "OrderDate",
            dataType: "date"
        }, {
            area: "row",
            dataField: "ShipCity"
        }, {
            area: "data",
            summaryType: "count"
        }]
    });

    $("#pivotGridContainer").dxPivotGrid({
        dataSource: pivotGridDataSource
    });
});
Angular
import PivotGridDataSource from "devextreme/ui/pivot_grid/data_source";
import { DxPivotGridModule } from "devextreme-angular";
// ...
export class AppComponent {
    pivotGridDataSource: PivotGridDataSource;
    constructor () {
        this.pivotGridDataSource = new PivotGridDataSource({
            store: {
                // ...
                // Underlying store is configured here
                // ...
            },
            fields: [{
                area: "column",
                dataField: "OrderDate",
                dataType: "date"
            }, {
                area: "row",
                dataField: "ShipCity"
            }, {
                area: "data",
                summaryType: "count"
            }]
        });
    }
}

@NgModule({
    imports: [
        // ...
        DxPivotGridModule
    ],
    // ...
})
<dx-pivot-grid
    [dataSource]="pivotGridDataSource">
</dx-pivot-grid>
Vue
<template>
    <DxPivotGrid
        :data-source="pivotGridDataSource"
    />
</template>

<script>
import PivotGridDataSource from 'devextreme/ui/pivot_grid/data_source';
import DxPivotGrid from 'devextreme-vue/pivot-grid';

const pivotGridDataSource = new PivotGridDataSource({
    store: {
        // ...
        // Underlying store is configured here
        // ...
    },
    fields: [{
        area: 'column',
        dataField: 'OrderDate',
        dataType: 'date'
    }, {
        area: 'row',
        dataField: 'ShipCity'
    }, {
        area: 'data',
        summaryType: 'count'
    }]
});

export default {
    components: {
        DxPivotGrid
    },
    data() {
        return {
            pivotGridDataSource
        }
    }
}
</script>
React
import React from 'react';

import PivotGridDataSource from 'devextreme/ui/pivot_grid/data_source';
import DxPivotGrid from 'devextreme-react/pivot-grid';

const pivotGridDataSource = new PivotGridDataSource({
    store: {
        // ...
        // Underlying store is configured here
        // ...
    },
    fields: [{
        area: 'column',
        dataField: 'OrderDate',
        dataType: 'date'
    }, {
        area: 'row',
        dataField: 'ShipCity'
    }, {
        area: 'data',
        summaryType: 'count'
    }]
});

class App extends React.Component {
    render() {
        return (
            <PivotGrid
                dataSource={pivotGridDataSource}
            />
        );
    }
}
export default App;

If you create a

PivotGridDataSource

instance outside the UI component (as shown above), make sure to

dispose

of it when it is no longer used. If the instance is created inside the UI component, it will be disposed of automatically.

The

PivotGridDataSource

is immutable. You cannot change its configuration at runtime. However, you can use its

methods

to manipulate it.

View Demo

This section describes properties that configure the PivotGridDataSource.

Name Description fields

Configures pivot grid fields.

filter

Specifies data filtering conditions. Cannot be used with an XmlaStore.

onChanged

A function that is executed after data is successfully loaded.

onFieldsPrepared

A function that is executed when all fields are loaded from the store and they are ready to be displayed in the PivotGrid.

onLoadError

A function that is executed when data loading fails.

onLoadingChanged

A function that is executed when the data loading status changes.

paginate

Specifies whether the PivotGridDataSource should load data in portions. Can be used only with an XmlaStore.

remoteOperations

Specifies whether the data processing operations (filtering, grouping, summary calculation) should be performed on the server.

retrieveFields

Specifies whether to auto-generate pivot grid fields from the store's data.

store

Configures the DataSource's underlying store.

The PivotGridDataSource allows you to specify CustomStore properties in its configuration object, as shown in the following code:

jQuery
var pivotGridDataSource = new DevExpress.data.PivotGridDataSource({
    load: function (loadOptions) {
        // Loading data objects
    },
    byKey: function (key) {
        // Retrieving a data object by key
    }
});
Angular
import PivotGridDataSource from "devextreme/ui/pivot_grid/data_source";
import CustomStore from "devextreme/data/custom_store";
// ...
export class AppComponent {
    pivotGridDataSource: PivotGridDataSource;
    constructor() {
        this.pivotGridDataSource = new PivotGridDataSource({
            store: new CustomStore({
                load: (loadOptions) => {
                    // Loading data objects
                },
                byKey: (key) => {
                    // Retrieving a data object by key
                }
            })
        });
    }
}
Vue
<script>
import PivotGridDataSource from 'devextreme/ui/pivot_grid/data_source';
import CustomStore from 'devextreme/data/custom_store';

const pivotGridDataSource = new PivotGridDataSource({
    store: new CustomStore({
        load: (loadOptions) => {
            // Loading data objects
        },
        byKey: (key) => {
            // Retrieving a data object by key
        }
    })
});

export default {
    // ...
    data() {
        return {
            pivotGridDataSource
        }
    }
}
</script>
React
// ...
import PivotGridDataSource from 'devextreme/ui/pivot_grid/data_source';
import CustomStore from 'devextreme/data/custom_store';

const pivotGridDataSource = new PivotGridDataSource({
    store: new CustomStore({
        load: (loadOptions) => {
            // Loading data objects
        },
        byKey: (key) => {
            // Retrieving a data object by key
        }
    })
});

class App extends React.Component {
    // ...
}
export default App;

This section describes methods that control the PivotGridDataSource.

This section describes events that the PivotGridDataSource raises.

Name Description changed

Raised after data is successfully loaded.

fieldsPrepared

Raised when all fields are loaded from the store and they are ready to be displayed in the PivotGrid.

loadError

Raised when data loading fails.

loadingChanged

Raised when the data loading status changes.

Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4