PDA

View Full Version : Best way to get complete store?



TheBuzzer
20 Jul 2010, 9:05 AM
It seems like

if a store is filtered, I could not get the complete list of models but just the filtered list.


So I am wondering could there be a method to get the complete list and not just part of the store that is filtered.

sven
21 Jul 2010, 2:37 AM
You can extend ListStore and add the following method:


public List<M> getSnapshot() {
return new ArrayList<M>(snapshot);
}

TheBuzzer
21 Jul 2010, 7:25 AM
I would have thought it would have been



public List<M> getAllModels() {
if (filtersEnabled) {
return new ArrayList<M>(snapshot);
} else {
return new ArrayList<M>(all);
}
}



I just need to return the snapshot only?

sven
21 Jul 2010, 7:31 AM
The code was just an example. Your is more complete and does not make any difference between filtern and nonfiltered