Search code examples
gxt

Tracking the Scroll and managing huge data in EditorTreeGrid


We have a requirement in which we need to load around 4000 records in two separate editor tree grids and highlight the differences in each record after doing comparison using values from a particular column in each tree . Everything's fine with a limited number of records but when we go up to 4000 records or more we have huge issues with the data. The tree grid takes around 10 minutes to render as it includes expanding all nodes, calculations to construct the parent child relation and then the highlight.

One solution I considered was trying a similar approach to Live Grid but for the highlighting logic we need all the records as the third record in Grid 'A' may match the 115th record in Grid 'B'.Live Grid would not have the previous selections when it brings the next set of records.

Considering the above, what would be the best way of achieving this? Can I just keep adding new records to the store as I scroll down ? I think it could be done by tracking the scroll position without using the Live Grid but am not sure how to achieve this. I'm not even sure if it's the right approach . Could anybody provide me some sample code to add elements to the store when user reaches the end of vertical scroll in EditorTreeGrid or suggest a better way to achieve this? My trial to add a scroll listener and a listener somehow doesn't kick in .

Also, the Live Grid uses List Store whereas I use the EditorTreeGrid . How do I effectively populate it to a tree store? I used to do getAllModels before and populate them into the TreeStore . Is it the right way to do this ?


Solution

  • In the end we ended up dumping the Tree structure and overrode the LiveGrid and LiveGridView to achieve this . LiveGrid does not load the complete data to the UI but tracks the scroll and brings in data on need basis.