Extjs TreeStore, more than one asynchronous requests, treepanel rendering dislocation

125 Views Asked by At

My extjs version is 6.5,I created a treepanel and GridPanel. When I click the record in GridPanel, the treeStore of treepanel will be triggered to load data. If I click the first record, TreeStore will load more data and slow down, but I have already clicked the second record. At the same time, the second click request has responded. As a result, treepanel will render the response data of the first click.

Ext.data.store does not have this problem. How can I solve this problem?

2

There are 2 best solutions below

1
On

You can listen to the load event on the treestore https://docs.sencha.com/extjs/6.5.3/modern/Ext.data.Store.html#event-load

and toggle grid.disableSelection(true); based on selection state https://docs.sencha.com/extjs/6.5.3/modern/Ext.grid.Grid.html#cfg-disableSelection

0
On

Do not do more than one load request at once. mask the grid on click and unmask it, when the store is loaded.