针对EXT-JS 的Grid, 若是想找到当前选择的行号,可以使用如下的方法:
其中grid为Grid对象引用,
var irow = grid.getSelectionModel().lastActive;
根据列名找到Grid中的列号:
var columnModel = grid.getColumnModel();
var icol = columnModel.findColumnIndex(colName);
根据行号和列号定位Grid view中的cell,
var cell = grid.getView().getCell(irow, icol);
cell.style.color='#ff0000';

本文介绍了如何在EXT-JS中操作Grid组件,包括获取当前选中的行号、通过列名查找列号以及根据行号和列号定位单元格等实用技巧。
207

被折叠的 条评论
为什么被折叠?



