GridPanel data remote paging and sorting support
Found: 7.1.0 Ext.NET Forums' thread: GridPanel remote paging problems
GridPanel paging and sorting historically been aided by helpers in Ext.NET 5. In particular the Ext.Net.Paging<T> type in Ext.NET 5- employs the required interface for response to such requests. This can be seen in these examples:
- WebForms > Grid Panels > Paging and Sorting > Handler
- MVC > Grid Panels > Paging and Sorting > Remote
Another approach is using Ext.NET's own Page Proxy, and implementation both client-side and server-side thought to improve the communication of the remote pages. This component extends Ext.data.proxy.Server.
Its main use is to provide the correct values through client-server communication like in
-
WebForms > GridPanel > Paging_and_Sorting > DirectMethod -- uses
PageProxy.DirectFnto wire up to a direct method. - WebForms > GridPanel > Locking_Grid > Infinite_Scrolling -- uses a JSON Reader directEvent.
But its use can be extrapolated just to improve the interface even if no paging is used (and all data from the grid should be fetched):
-
WebForms > GridPanel > Miscellaneous > Export_Data_Ajax -- uses a directEvent with nice
StoreReadEventArgs, but no page size information at all (return all -- sorting unspecified -- data).
This PageProxy basically sends a request like (when using JSON Reader):
"page":88,
"start":8700,
"limit":100,
"sort": "[{\"property\":\"Company\",\"direction\":\"ASC\"}]"
Notice the sort member is a string of a nested json.
As for the response, it usually involves an object with two members: one containing the data itself for the specific page, and another for the total count, which would allow the pager to know how many pages it should be informed to page switching toolbar. In practice,
"data": [{
(data entries here)
}],
"total": 50000
The data and total fields being configurable, respectively, via the reader's RootProperty and TotalProperty, respectively.
When the directFn (using direct methods to fetch pages) is employed, the returned value can be either a generic object with a List<T> and an integer, the Paging<T> with Data and TotalRecords filled, or an anonymous new { data = List<T>(), total = integer }. There is also the StoreRequestParameters class to make it easy to map the parameters from the specified Dictionary<string, object> extra parameters (see the related example for more details).
All examples on WebForms Examples Explorer using the feature:
WebForms examples matching ext:PageProxy
- Associations > HasMany > Lazy_Load
- Associations > HasOne > Simple_Lazy_Load
- Data_Binding > Basic > Associations
- Data_Binding > Basic > Isolated_Child_Sessions
- Form > ComboBox > Linked_Combos_In_Grid
- Form > Miscellaneous > Edit_Form_View
- GridPanel > ArrayGrid > PageProxy_with_DirectMethod
- GridPanel > Data_Presentation > Meta_config
- GridPanel > FilterHeader > Infinite_Remote_Sql
- GridPanel > FilterHeader > Remote
- GridPanel > Infinite_Scrolling > Overview
- GridPanel > Locking_Grid > Infinite_Scrolling
- GridPanel > Miscellaneous > Details_Window_Remote
- GridPanel > Miscellaneous > Export_Data_Ajax
- GridPanel > Paging_and_Sorting > DirectMethod
- GridPanel > Paging_and_Sorting > Local_Paging_with_Remote_Data
- GridPanel > Paging_and_Sorting > Page
- GridPanel > Plugins > GridFilters_Remote
- GridPanel > Plugins > Remote_GroupSummary
- GridPanel > Saving_Variations > StoreCustomLogic
- GridPanel > Saving_Variations > StoreEvents
- GridPanel > Update > SqlDataSource
- TreePanel > Basic > DragDrop_Between_Trees
- TreePanel > Basic > SiteMap
- TreePanel > Loaders > Page