Your search did not match any results.
Pivot Grid

Web API Service

The PivotGrid can communicate with a Web API service. The quantity of aggregated data is irrelevant when aggregation is performed on the server. For example, the widget works with a million aggregated records in this demo.

To configure access to a Web API service from the client, use the createStore method (part of the DevExtreme.AspNet.Data extension).

You should also set the remoteOperations option to true to notify the PivotGrid that data is aggregated on the server.

Copy to CodeSandBox
Apply
Reset
<template> <dx-pivot-grid :allow-sorting="true" :allow-sorting-by-summary="true" :allow-filtering="true" :height="620" :show-borders="true" :data-source="dataSource" row-header-layout="tree" > <dx-scrolling mode="virtual" /> </dx-pivot-grid> </template> <script> import { DxPivotGrid, DxScrolling } from 'devextreme-vue/pivot-grid'; import { createStore } from 'devextreme-aspnet-data-nojquery'; export default { components: { DxPivotGrid, DxScrolling }, data() { return { dataSource: { remoteOperations: true, store: createStore({ key: 'OrderID', loadUrl: 'https://js.devexpress.com/Demos/WidgetsGalleryDataService/api/Sales/Orders' }), fields: [{ caption: 'Category', dataField: 'ProductCategoryName', width: 250, expanded: true, sortBySummaryField: 'SalesAmount', sortBySummaryPath: [], sortOrder: 'desc', area: 'row' }, { caption: 'Subcategory', dataField: 'ProductSubcategoryName', width: 250, sortBySummaryField: 'SalesAmount', sortBySummaryPath: [], sortOrder: 'desc', area: 'row' }, { caption: 'Product', dataField: 'ProductName', area: 'row', sortBySummaryField: 'SalesAmount', sortBySummaryPath: [], sortOrder: 'desc', width: 250 }, { caption: 'Date', dataField: 'DateKey', dataType: 'date', area: 'column' }, { caption: 'Amount', dataField: 'SalesAmount', summaryType: 'sum', format: 'currency', area: 'data' }, { caption: 'Store', dataField: 'StoreName' }, { caption: 'Quantity', dataField: 'SalesQuantity', summaryType: 'sum' }, { caption: 'Unit Price', dataField: 'UnitPrice', format: 'currency', summaryType: 'sum' }, { dataField: 'Id', visible: false }] } }; } }; </script>
import Vue from 'vue'; import App from './App.vue'; new Vue({ el: '#app', components: { App }, template: '<App/>' });
<!DOCTYPE html> <html> <head> <title>DevExtreme Demo</title> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/19.1.5/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/19.1.5/css/dx.light.css" /> <script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script> <script src="https://unpkg.com/systemjs@0.21.3/dist/system.js"></script> <script type="text/javascript" src="config.js"></script> <script type="text/javascript"> System.import('./index.js'); </script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="app"/> </div> </body> </html>
System.config({ transpiler: 'plugin-babel', paths: { 'npm:': 'https://unpkg.com/' }, map: { vue: 'npm:vue@2.6.3/dist/vue.esm.browser.js', 'vue-loader': 'npm:systemjs-vue-browser@latest/index.js', 'devextreme': 'npm:devextreme@19.1', 'devextreme-vue': 'npm:devextreme-vue@19.1', jszip: 'npm:jszip@3.1.3/dist/jszip.min.js', 'quill': 'npm:quill@1.3.6/dist/quill.js', 'devexpress-diagram': 'npm:devexpress-diagram', 'devextreme-aspnet-data-nojquery': 'npm:devextreme-aspnet-data-nojquery@2.4.2', 'plugin-babel': 'npm:systemjs-plugin-babel@0/plugin-babel.js', 'systemjs-babel-build': 'npm:systemjs-plugin-babel@0/systemjs-babel-browser.js' }, meta: { '*.vue': { loader: 'vue-loader' }, 'devextreme-aspnet-data-nojquery': { 'esModule': true } }, packages: { 'devextreme-vue': { main: 'index.js' }, 'devextreme': { defaultExtension: 'js' } }, babelOptions: { sourceMaps: false, stage0: true } });