How to do I materialize rows in an ODataVirtualCollectionView

Posted by: p.wijmo on 22 September 2021, 6:07 am EST

  • Posted 22 September 2021, 6:07 am EST

    I’m simplifying the numbers here but:

    I have an ```

    ODataVirtualCollectionView

    
    There are 20,000 rows in the result set in question; the [b]Pagesize[/b] for the view is set to 200.
    
    I have selection row 10,000 in the grid, and used shift-click to select row 15,000
    
    I now want to materialize the rows represented by that selection.
    
    The method I'm using at the moment to call ```
    setWindow(10,000, 15,000)
    ``` on the view and then poll the underlying collection to check if all of the rows I'm interested in are non-null.
    
    I can see in the background that the view makes several odata calls to backfill the data after the ```
    setWindow
    ``` call has been made. It makes ~5 calls,  as the page size on the server is set to 1,000.
    
    I can see that all of the data I need has been returned as far as the network calls are concerned by examining the return values for each call in Chrome debugger network tab.
    
    However when I check the underlying ```
    items
    ``` or ```
    sourceCollection
    ``` properties of the view, the full set of rows have not been populated and in fact the number seems to vary up and down.
    
    I do this check once every couple of seconds on the equivalent of a timer.
    
    What do I need to do to reliably materialize data in to a virtual collection like this?
    
    Is there a single event I can hook into that tells me that ```
    setWindow
    ``` has finished satisfying the request, and what should I look at to be certain I have all of the data?
  • Posted 24 September 2021, 10:43 am EST

    Hello,

    We are working on the issue and will update you on this shortly.

    Regards

  • Posted 27 September 2021, 2:06 am EST

    Hello,

    We have created an enhancement request for the same with the internal tracking id WJM-20983. This feature will be implemented in future releases if found feasible.

    We will let you know as soon as we get any update on this.

    Regards

  • Posted 30 September 2021, 10:09 am EST

    Thanks for this. For the time being, I’m manually calling the oData endpoint and accumulating the data that would have been fetched by the grid, but independently of the grid itself.

    A follow up that should probably be a separate question:

    When a grid has “selectionMode” set to “ListBox”, selecting a batch of lines and then scrolling around the grid appears to fire a selectionChanged event for each selected line individually after I call “setWindow”, with the cell range in each event spanning a single row.

    This is causing my grid to lock for minutes at a time when I try to scroll.

    If “selectionMode” is set to “RowRange” a single “selectionChanged” event fires when the scroll position changes, and the cell range is the full span of rows selected.

    Is this a known issue?

  • Posted 1 October 2021, 6:05 am EST

    Hello,

    No, this seems like a bug, we have reported the issue to the Dev team with an internal tracking id WJM-21010. We will let you know as soon as we get any updates on this.

    Sorry for the inconvenience.

    Regards

  • Posted 1 October 2021, 6:54 am EST

    Thanks again - half the battle is knowing if you’ve misunderstood the documentation or if it’s actually a bug.

    I believe we have a support contract for a certain number of incidents, so you may see a duplicate bug filed for this in a slightly more official way - I’ll be sure to quote that reference if we do report it.

  • Posted 4 October 2021, 2:37 am EST

    Hello,

    We are glad that we were able to help you. Please let us know if you have any further queries.

    Regards

Need extra support?

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

Learn More

Forum Channels