Search code examples
gwtgxt

GXT3: How to get all items from a TreeStore including the ones filtered out


I implemented a modified view for my data using the filters, which only shows the modified items. And I have auto-saving feature. The issue is that when users edit data in the modified view, my auto-save method will override the original data with the ones in my modified view.

Is there a way to get all items from a TreeStore other than removing its filters? (I can surely remove the filters and add them back, but I did a lot of things in my SelectionChangedHandler, which made this approach very hard to achieve.)

Any help will be appreciated.


Solution

  • From the sencha docs:

    As with ListStore, all changes and data are relative to what is currently visible, due to the Store.StoreFilters. As such, if filters are active and structural changes are required, it might be necessary to disable filters to make the change, re-enabling them when finished.

    You might have to keep a separate list of all the objects or at least a list of the ones that were filtered out.