DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

JavaScript/jQuery Data Grid - Remote Virtual Scrolling

With remote virtual scrolling, pages are loaded from the server when they enter the viewport. To enable this feature, set the scrolling.mode property to "virtual" and the remoteOperations property to true. The latter informs the JavaScript DataGrid that the server handles paging.

Backend API
$(() => { $('#gridContainer').dxDataGrid({ dataSource: DevExpress.data.AspNet.createStore({ key: 'Id', loadUrl: 'https://js.devexpress.com/Demos/WidgetsGalleryDataService/api/Sales', }), remoteOperations: true, scrolling: { mode: 'virtual', rowRenderingMode: 'virtual', }, paging: { pageSize: 100, }, headerFilter: { visible: true, search: { enabled: true, }, }, wordWrapEnabled: true, showBorders: true, columns: [{ dataField: 'Id', width: 90, }, { caption: 'Store', dataField: 'StoreName', width: 150, }, { caption: 'Category', dataField: 'ProductCategoryName', width: 120, }, { caption: 'Product', dataField: 'ProductName', }, { caption: 'Date', dataField: 'DateKey', dataType: 'date', format: 'yyyy-MM-dd', width: 110, }, { caption: 'Amount', dataField: 'SalesAmount', format: 'currency', headerFilter: { groupInterval: 1000, }, width: 100, }], }); });
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" lang="en"> <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=5.0" /> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script>window.jQuery || document.write(decodeURIComponent('%3Cscript src="js/jquery.min.js"%3E%3C/script%3E'))</script> <link rel="stylesheet" type="text/css" href="https://cdn3.devexpress.com/jslib/24.2.3/css/dx.light.css" /> <script src="js/dx.all.js"></script> <script src="https://unpkg.com/devextreme-aspnet-data@5.0.0-rc1/js/dx.aspnet.data.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="gridContainer"></div> </div> </body> </html>
#gridContainer { height: 440px; }

In this demo, the server contains 1,000,000 records and returns 100 records per page. The page size is set using the paging.pageSize property. The larger it is, the fewer requests are sent to the server. To reduce the time required for rendering the loaded rows, set the scrolling.rowRenderingMode to "virtual" — the JavaScript DataGrid renders only rows that are in the viewport.

NOTE

The data source in this demo is configured to return only 1000 records per request.