-
31 Mar 2012 5:30 AM #1
Store instances
Store instances
I believe this has been duscussed before, but I'm simply unable to find answer elsewhere.
Store has nice feature that when I update it in one place, update is reflected on all components that are using it. However, is there a way to load 2 or more grids attached to stores with same definitions, but not same stores? E.g. is there a way to make every grid create it's own instance and use it so when I filter it or sort it, it is not reflected on another grid?
-
31 Mar 2012 8:47 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
Just create a new instance of the store each time you create an instance of the grid.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
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 services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
2 Apr 2012 1:02 AM #3
In button click I have:
How do I create store when it is defined in grid's config?Code:listInvoices: function(button) { il = new Ext.widget('invoicelist'); il.show(); }
-
2 Apr 2012 1:25 AM #4
Try to create instance in grid's initComponent method.
Demo http://ext4all.com/post/how-to-make-...store-instance
-
2 Apr 2012 2:03 AM #5
Do I have to "extend" grid in order to do it? In my case, I'm creating widget based on Window, and grid is element with store: myStore config.
-
2 Apr 2012 2:33 AM #6
You can provide store in initComponent of window.
Demo here http://ext4all.com/post/how-to-make-...nstance-part-2
-
2 Apr 2012 2:50 AM #7


Reply With Quote