-
30 May 2012 12:48 AM #1
Unanswered: store accessibility
Unanswered: store accessibility
In below code am not able to access the store2 in display function tried with "this" "global" but fail to access the store2,am just creating copy of original store with store2 in insert function origional store will be get changed by filter so wanted to access origional store again in display function,Any idea or suggestions for this
insert: function(){
var store = this.panel.getStore();
var records1 = [];
store.each(function(r){
records1.push(r.copy());
});
var store2 = new Ext.data.Store({
recordType: store.recordType
});
}
display: function()
{ //How i can access the store2 here }
-
30 May 2012 1:14 AM #2
you can create store2 variable on a global scope (outside the insert function).
or assign a storeId to store2 and use that to access it.Code:var store2; insert: function(){ store2 = new Ext.data.Store.... } display: function() { // store2 is now accessible here }
-
30 May 2012 1:27 AM #3Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
Make custom config to your store2 variable
Make custom config to your store2 variable
hi prakashkadakol,
Try this one
Code:insert: function(){ var store = this.panel.getStore() , records1 = []; store.each(function(r){ records1.push(r.copy()); }); this.store2 = new Ext.data.Store({ recordType: store.recordType }); } display: function(){ var data = this.store2; ............ }sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.


Reply With Quote