How to list all cells in grid?
for example:
for row in rows开发者_开发百科:
for col in cols:
print cell[row,col]
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...
精彩评论