Sencha 2 "child store" or "sub store"
Just had a revelation when it comes to data stores inside Sencha Touch.
I was treating stores as a central repository of data I've loaded from the server, and used those same stores to populate my lists and data views. I was doing this because I was under the impression that I was saving memory and resources.
Problem was - I was seeing a lot of my views slow down, because I had to filter each store on show of the view. Another problem I was running into was looking up items in the store when I had filters applied. This was quickly becoming messy.
It took me awhile, but I realized that I should have stores for each view component, and simply populate them with data I'm keeping in "central stores". The stores for each view can then be filtered & sorted without causing item lookup issues or performance problems.
Taking a page from SQL I came up with the idea of a "ChildView" store to use for my lists and other data views. Set a parentStore on the ChildView, then you can filter away at the ChildVIew without effecting your central data.
You can even set a "queryFunc" to restrict the type of data that gets pulled from your parentStore. This data is kept in sync by watching the events on parentStore, and reloading it as items change.
Would love to hear feedback on this, and hopefully it helps someone having the same problems I was.