Posted 4 October 2019, 10:34 am EST
Hi,
im using this example https://www.grapecity.com/wijmo/demos/Grid/Data-binding/InfiniteScrolling/angular to implement infinite scroll and getting data from OData api.
In this example we have flexgrid.scrollPositionChanged handler where it is detected when the bottom of list is reached.
So when this is detected, i increase odata skip property and then call my odata api to get next batch of data, for example http://myAPI/odata/myTable?$skip=50&$top=50 to get second batch of data. After i get new batch of data, i append it to the existing data and this way infinite scroll works ok.
The problem with this approach is that when i add FlexGridFilter to my grid, filtering is not done on server, like it would be done if i would use ODataCollectionView class and set property filterOnServer to true.
Now i see two solutions to my problem:
-
Is it possible to use this approach of infinite scroll with ODataCollectionView Class? Is there a way, when i reached bottom row on my grid, to “say to ODataCollectionView class” increase odata skip property and then append new data to the rest of the data?
-
So second approach, with my current solution, would be that when user changes a filter, i get filterDefinition from FlexGridFilter class and then convert it to odata filter string to use it to call my odata api.
Is it possible that i could get this filter odata string directly from FlexGridFilter class?
Since ODataCollectionView class is already doing this (when filterOnServer is set to true) then i guess that functionality to convert filterDefinition to odata filter string is already somewhere there.
Do you maybe have any other suggestions to this problem?
Thank you and regards