13 Apr 2012 6:54 AM #1
Answered: Stores and SubStores
I´m just curious if this is possible.
The ability to create a store, which contains data from either a json file or local storage.
Then there´s a store which is linked to it that which gets its data from that store, and can be filtered to show certain data. This is for lists, so many lists can get their data from one store through a personal substore.
Is this possible?
I was hoping this would be possible because currently, my application creates alot of fields, alot containing xtype: 'field' with lists within them, and was wondering if this would help speed up the application.
This would be possible but there is nothing within Sencha Touch that will do this out of the box.
13 Apr 2012 7:10 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
This would be possible but there is nothing within Sencha Touch that will do this out of the box.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services firstname.lastname@example.org
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
15 Apr 2012 11:19 PM #3
hey, thanks for the reply.
well if done, would it help speed up the application if there are many stores in use?
16 Apr 2012 1:30 AM #4
would this maybe be possible by using a DirectStore providing a delegate on the 'global' store as directFN
16 Apr 2012 4:45 AM #5
am not an advanced sencha user tho, so although i know a bit i dont really know how to use a direct store nor delegate.
how would one go about doing this?
thanks in advance!
16 Apr 2012 7:16 AM #6
well, i have nearly the same problem. and I'm still searching for a nice solution. with a direct store you can specify your own methods for the crud operations which return the wished records. so you could specify a function which calls the super store to load the items, maybe applying some filters or options. the super store will store them and pass them in some way to your function.
i need to try this solution, but this is not on top of my todo list. i need this solution for my bachelor thesis but there are other problems & questions that i have to solve and answer first.
Take a look at DirectStore in Sencha Documentation. You'll need to provide the so called directFn (it should be possible to provide them for each of the CRUD operations). These methods need to call the super store's CRUD methods.