Zambezi Grid Server side filter and sorting
When a data set is too large, it might not make sense to send it all at once to the client. You might want to populate a grid little by little, requesting data as needed.
The Zambezi Grid supports sparse datasets it can run in server side filter and sort mode by turning it on with serverSideFilterAndSort
getter/setter.
When this is turned on, no attempt to filter or sorting will be done by the grid.
You can use the grid events to request the relevant data from the server.
You can use the following grid events to request additional data rows from the server. Once you get the new rows, you can merge or replace them and redraw the grid.
sort-changed
will pass your handler the column related to the header's sort gesturevisible-lines-change
will pass your handler information about the currently visible rows in the grid.
In this example we fake remote calls to fetch additional paginated data. An empty array of length 50K is passed to the grid; the length determines how much you can scroll.
If you scroll slowly (perhaps by using the mouse wheel over the scroller) you'll see the rows being added to the grid as they "arrive". If you open the console in the developer tools you'll see the sort events dispatched, which can be used to request the appropriate sorted data slice.