Ext.NET icon indicating copy to clipboard operation
Ext.NET copied to clipboard

GridPanel data remote paging and sorting support

Open fabriciomurta opened this issue 5 years ago • 0 comments

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:

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

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):

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

  1. Associations > HasMany > Lazy_Load
  2. Associations > HasOne > Simple_Lazy_Load
  3. Data_Binding > Basic > Associations
  4. Data_Binding > Basic > Isolated_Child_Sessions
  5. Form > ComboBox > Linked_Combos_In_Grid
  6. Form > Miscellaneous > Edit_Form_View
  7. GridPanel > ArrayGrid > PageProxy_with_DirectMethod
  8. GridPanel > Data_Presentation > Meta_config
  9. GridPanel > FilterHeader > Infinite_Remote_Sql
  10. GridPanel > FilterHeader > Remote
  11. GridPanel > Infinite_Scrolling > Overview
  12. GridPanel > Locking_Grid > Infinite_Scrolling
  13. GridPanel > Miscellaneous > Details_Window_Remote
  14. GridPanel > Miscellaneous > Export_Data_Ajax
  15. GridPanel > Paging_and_Sorting > DirectMethod
  16. GridPanel > Paging_and_Sorting > Local_Paging_with_Remote_Data
  17. GridPanel > Paging_and_Sorting > Page
  18. GridPanel > Plugins > GridFilters_Remote
  19. GridPanel > Plugins > Remote_GroupSummary
  20. GridPanel > Saving_Variations > StoreCustomLogic
  21. GridPanel > Saving_Variations > StoreEvents
  22. GridPanel > Update > SqlDataSource
  23. TreePanel > Basic > DragDrop_Between_Trees
  24. TreePanel > Basic > SiteMap
  25. TreePanel > Loaders > Page

fabriciomurta avatar Nov 23 '20 19:11 fabriciomurta