Hello. I use devExpress for js to have a dxdataGrid table with a datasource and a column implementing the drop-down list via lookup, which refers to its dataSource. Pagination is enabled in both cases.
this.$scope.dxGridLocalConfig = { dataSource: AService.dataSource, paging: { enabled: true, pageSize: 25 }, columns: [{ dataField: 'SId', caption: 'S', lookup: { dataSource: { store: SService.store, paginate: true, pageSize: 25, }, valueExpr: 'Id', displayExpr: 'FullName' } }] } The problem is that loading a page with such a grid. First, there is a request for a source with data with regard to pagination for the entire table (I use the odata DataSource)
http://localhost/odata/A?%24orderby=Id&%24top=25&%24count=true then comes the query to
http://localhost/odata/S which requests ALL records instead of either not asking for anything or only the first 25. DataSource I have described through
this.store = ODataService.context.S; this.dataSource = new DevExpress.data.DataSource({ store: this.store, paginate: true, pageSize: 25, }); and context in turn
this.context = new DevExpress.data.ODataContext({ url: `localhost/odata/`, entities: { S: { key: 'Id', keyType: 'Int32' }, When this is clicked inside the associated field, the field opens with scrolling and works as it should, that is, there is a gradual loading by requests of the form
http://localhost/odata/S?%24skip=50&%24top=25 The only thing I want to avoid is downloading all the data from the associated fields, because there is a lot of data and it turns out that in the table with 3 records in the background, another 1.5 million is pulled, respectively, all this is very slow. So it should not be
UPD: Prepared (or rather adapted) an example of the problem
/// <reference path="C:/Program Files (x86)/DevExpress 16.1/DevExtreme/Sources/Lib/ts/jquery.d.ts" /> /// <reference path="C:/Program Files (x86)/DevExpress 16.1/DevExtreme/Sources/Lib/ts/dx.all.d.ts" /> $(function() { var context = new DevExpress.data.ODataContext({ url: "http://services.odata.org/V4/Northwind/Northwind.svc/", entities: { Categories: { key: "CategoryID", keyType: "Int32", }, Suppliers: { key: "SupplierID", keyType: "Int32", }, Products: { name: "Products", key: "ProductID", expand: ["Category"], keyType: "Int32" } }, version: 4 }) $("#grid").dxDataGrid({ dataSource: context.Products, paging: { enabled: true, pageSize: 1 }, columns: ["ProductID", { dataField: "ProductName", }, { dataField: "SupplierID", lookup: { dataSource: { store: context.Suppliers, paginate: true, pagesize: 3 }, displayExpr: "ContactName", valueExpr: "SupplierID" } }, { dataField: "CategoryID", lookup: { dataSource: { store: context.Categories, paginate: true, pagesize: 3 }, displayExpr: "CategoryName", valueExpr: "CategoryID" } } ], pagesize: 5, filterRow: { visible: true }, headerFilter: { visible: true }, groupPanel: { visible: true } }); }); <!DOCTYPE html> <html> <head> <title>DevExtreme jQuery site</title> <meta charset="utf-8" /> <link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/16.2.5/css/dx.common.css" /> <link rel="stylesheet" type="text/css" href="http://cdn3.devexpress.com/jslib/16.2.5/css/dx.light.css" /> <script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.2.4.min.js"></script> <script type="text/javascript" src="http://cdn3.devexpress.com/jslib/16.2.5/js/dx.all.js"></script> <script type="text/javascript" src="16.2.4.js"></script> </head> <body> <div id="grid"></div> </body> </html> The page size is set to 1 record, but when the Suppliers page loads, all 29 are received with the request (and if there were not 29 but 1.5 million), although only one is needed to fully display the page. can i where kosyachu?