Your search did not match any results.
Data Grid

Remote Grouping

Documentation
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 Country and City 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 Codepen
Apply
Reset
window.onload = function() { var priority = [ { name: "High", value: 4 }, { name: "Urgent", value: 3 }, { name: "Normal", value: 2 }, { name: "Low", value: 1 } ]; var viewModel = { dataGridOptions: { dataSource: { store: { type: "odata", url: "https://js.devexpress.com/Demos/DevAV/odata/Tasks" }, expand: "ResponsibleEmployee", select: [ "Task_ID", "Task_Subject", "Task_Start_Date", "Task_Due_Date", "Task_Status", "Task_Priority", "ResponsibleEmployee/Employee_Full_Name" ] }, scrolling: { mode: "virtual" }, groupPanel: { visible: true }, columns: [ { dataField: "Task_ID", width: 90 }, { caption: "Subject", dataField: "Task_Subject", width: 190 }, { caption: "Status", dataField: "Task_Status", groupIndex: 0 }, { caption: "Priority", dataField: "Task_Priority", lookup: { dataSource: priority, valueExpr: "value", displayExpr: "name" }, groupIndex: 1 }, { caption: "Assigned To", dataField: "ResponsibleEmployee.Employee_Full_Name", allowGrouping: false, allowSorting: false }, { caption: "Start Date", dataField: "Task_Start_Date", dataType: "date" }, { caption: "Due Date", dataField: "Task_Due_Date", dataType: "date" } ] } }; ko.applyBindings(viewModel, document.getElementById("data-grid-demo")); };
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <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" /> <script src="js/jquery-3.1.0.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.0/knockout-min.js"></script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.3/css/dx.spa.css" /> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/17.1.3/css/dx.common.css" /> <link rel="dx-theme" data-theme="generic.light" href="https://cdn3.devexpress.com/jslib/17.1.3/css/dx.light.css" /> <script src="https://cdn3.devexpress.com/jslib/17.1.3/js/dx.all.js"></script> <link rel="stylesheet" type ="text/css" href ="styles.css" /> <script src="index.js"></script> </head> <body class="dx-viewport"> <div class="demo-container"> <div id="data-grid-demo"> <div id="gridContainer" data-bind="dxDataGrid: dataGridOptions"></div> </div> </div> </body> </html>
#gridContainer { height: 420px; }