Bdfy
Bdfy

Reputation: 24621

How to list all cells in grid?

for example:

for row in rows:

for col in cols:

 print cell[row,col]

Upvotes: 0

Views: 380

Answers (1)

NT3RP
NT3RP

Reputation: 15370

Assuming you have an Ext.data.Store from your grid (or in general), you can interate through through it as follows:

var store = grid.getStore();

var records = store.getRange();

for(var i = 0; i < records.length; i++) {
    for(var index in records[i]) {
        if (records[i].hasOwnIndex(index)) {
            //not sure how you want to print this, so for now, print to console
            console.log(records[i][index])
        }
    }
}

...However, if you have an Ext.grid.GridPanel, I'm not sure why you would want to do this manually...

Upvotes: 1

Related Questions