user1158628
user1158628

Reputation: 33

Access store in grid panel Extjs

This could be a stupid question, but I cant figure out how to access store in gridpanel

  var grid = new Ext.grid.GridPanel({
    .....
    store: store,
    ......
      listeners: {
        'beforerender' : function(grid) {
          //grid.getStore();
            }
           }

I want to loop through the store , but grid.getStore() returns empty object.

Upvotes: 0

Views: 6668

Answers (2)

e-zinc
e-zinc

Reputation: 4581

store variable is still visible in your listener code :)

Upvotes: 0

egerardus
egerardus

Reputation: 11486

you can simply do grid.store.

If you know it will be filled with data before the grid renders (you seem to be calling this from the grid beforerender event) you can do grid.store.getRange() to get the records that you want to loop through, as you mentioned in your question.

Upvotes: 1

Related Questions