Results 1 to 3 of 3

Thread: store accessibility

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    69
    Answers
    2
    Vote Rating
    0
      0  

    Default 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 }

  2. #2
    Touch Premium Member
    Join Date
    Jun 2011
    Posts
    1,099
    Answers
    113
    Vote Rating
    100
      0  

    Default

    you can create store2 variable on a global scope (outside the insert function).

    Code:
    var store2;
    
    insert: function(){
      store2 = new Ext.data.Store....
    }
    
    display: function() {
      // store2 is now accessible here
    }
    or assign a storeId to store2 and use that to access it.

  3. #3
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335
    Answers
    124
    Vote Rating
    90
      0  

    Default 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.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •