Remote paging in web-based grids is a technique used to efficiently manage and display large datasets in a grid or table format, where data is fetched from a remote data source, typically a server, in smaller chunks or pages as needed. This approach offers several benefits in web applications, particularly when dealing with large datasets:
Improved Performance: Remote paging helps improve the performance of your web application because it reduces the amount of data transferred between the server and the client. Instead of loading the entire dataset at once, only a limited number of records (a page) are fetched at a time, which reduces the load time and makes the application more responsive.
Reduced Bandwidth Usage: Loading only a portion of the data at a time minimizes the amount of data sent over the network, conserving bandwidth. This is particularly important for users with slower internet connections or when dealing with mobile devices.
Faster Initial Page Load: Web pages load more quickly when they don't have to fetch and render a large dataset all at once. Remote paging allows you to load just the first page of data initially and then fetch additional pages as the user interacts with the grid.
Better User Experience: Users can navigate through the data more efficiently because they can access specific pages or request more data as needed. This provides a smoother and more responsive user experience.
Scalability: Remote paging makes it feasible to work with extremely large datasets without overloading the client-side application. This is crucial for enterprise-level applications that handle vast amounts of data.
Server-Side Filtering and Sorting: With remote paging, you can offload filtering and sorting operations to the server, ensuring that only the required data is transmitted to the client. This reduces the burden on the client and can take advantage of server-side optimizations.
In pqgrid, the data can be loaded from remote server one page at a time by setting following options
pageModel.type
to 'remote'dataModel.location
to 'remote'dataModel.url
to url of remote scriptGrid sends pq_curpage
and pq_rpp
parameters to remote script.
In return remote script sends back following JSON data
{ totalRecords: count of total records ( number ) curPage: current page no ( number ) data: data of current page ( Array of rows ) }If the key names are named differently in json response, they can be mapped to required key names in
dataModel.getData
method.