Your search did not match any results.
Data Grid

Remote Grouping


The DataGrid widget allows your end users to shape data as needs dictate. In this example, we demonstrate the use of the built-in data grouping feature against a remote data source. Data is provided by an OData service and grid content is grouped by both Status and Priority columns. Note that this demo uses the DataGrid in a virtual mode and loads data on-demand as the grid content is scrolled vertically.

Copy to CodeSandBox
<template> <dx-data-grid id="gridContainer" :data-source="dataSource" :show-borders="true" > <dx-column :width="90" data-field="Task_ID" /> <dx-column :width="190" data-field="Task_Subject" caption="Subject" /> <dx-column :group-index="0" data-field="Task_Status" caption="Status" /> <dx-column :group-index="1" data-field="Task_Priority" caption="Priority" > <dx-lookup :data-source="priority" value-expr="value" display-expr="name" /> </dx-column> <dx-column :allow-sorting="false" :allow-grouping="false" data-field="ResponsibleEmployee.Employee_Full_Name" caption="Assigned To" /> <dx-column data-field="Task_Start_Date" data-type="date" caption="Start Date" /> <dx-column data-field="Task_Due_Date" data-type="date" caption="Due Date" /> <dx-group-panel :visible="true"/> <dx-scrolling mode="virtual"/> </dx-data-grid> </template> <script> import { DxDataGrid, DxColumn, DxGroupPanel, DxScrolling, DxLookup } from 'devextreme-vue/data-grid'; import 'devextreme/data/odata/store'; export default { components: { DxDataGrid, DxColumn, DxGroupPanel, DxScrolling, DxLookup }, data() { return { dataSource: { store: { type: 'odata', url: '' }, expand: 'ResponsibleEmployee', select: [ 'Task_ID', 'Task_Subject', 'Task_Start_Date', 'Task_Due_Date', 'Task_Status', 'Task_Priority', 'ResponsibleEmployee/Employee_Full_Name' ] }, priority: [ { name: 'High', value: 4 }, { name: 'Urgent', value: 3 }, { name: 'Normal', value: 2 }, { name: 'Low', value: 1 } ] }; } }; </script> <style scoped> #gridContainer { height: 420px; } </style>
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="" /> <link rel="dx-theme" data-theme="generic.light" href="" /> <script src=""></script> <script src=""></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"> <span v-if="false">Loading...</span> </div> </div> </body> </html>
System.config({ transpiler: 'plugin-babel', paths: { 'npm:': '' }, map: { vue: 'npm:vue@2.5.16/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', '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' } }, packages: { 'devextreme-vue': { main: 'index.js' }, 'devextreme': { defaultExtension: 'js' } }, babelOptions: { sourceMaps: false, stage0: true } });