Infinite Scroll and filtering on server

Posted by: bozjator on 4 October 2019, 10:34 am EST

    • Post Options:
    • Link

    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:

    1. 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?

    2. 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

  • Posted 7 October 2019, 3:22 am EST

    Hi,

    Wijmo has this functionality inbuilt for ODataVirtualCollectionView class. It does not load the data at once, it loads data based on the current view.

    Please refer to the following demo sample for reference:

    https://www.grapecity.com/wijmo/demos/Grid/Data-binding/VirtualOData/angular

    Hope this answers your both of the queries.

    Please let us know if you have any further queries.

    Regards,

    Manish Gupta

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels