TreeGrid: preserve collapsed/expanded state


what is the best way to keep the collapsed/expanded state after the DataProvider of a TreeGrid was refreshed?

Thanks in advance!

Hi, it’s been a longe time ago, you asked this question. Now I am a the point where I have the same problem.

Do you or anybody have an answer for this?

Hello. If there are few items, you may iterate over them and ask whether they are expanded (treeGrid.isExpanded). Otherwise, you may track the state changes with expand/collapse listeners. In both cases. after updating the DataProvider, call treeGrid.expand with the collection of items that have been expanded (TreeGrid tracks that list, but it’s in a private attribute and there is no API support for retrieving it)