1. 程式人生 > >遍歷Grid每行,每格的資料

遍歷Grid每行,每格的資料

var
 grid 
=
 .....;
var store = grid.store;
var rowCount = store.getCount(); // 記錄數 var cm = grid.getColumnModel();
var colCount = cm.getColumnCount(); // 列數 var view = grid.getView();
for (i = 0 ;i < rowCount;i ++ ){
for (j = 0 ;j < colCount;j ++ ){
var cell = view.getCell(i,j);
alert(cell.innerHTML);
// 第i行j列的資料 }
}