我正在使用带有操作列的网格。最近我添加了分组功能。现在,如果我在我的选择上方折叠一个或多个组,我会得到不正确的行索引。即,当存在折叠组时,组内的所有行都不会计算行索引。
下面是我的操作列处理程序
{
iconCls: 'download',
align: 'center',
tooltip: 'Download File',
handler: function(grid, rowIndex, colIndex) {
console.log(rowIndex, colIndex);
var rec = grid.getStore().getAt(rowIndex);
// need to find the correct record
}
}
任何帮助将不胜感激
最佳答案
如果您只需要获取您的记录,则该信息已经是您的处理程序的参数。如果您确实需要索引,请使用该参数来查询您的商店。
{
iconCls: 'download',
align: 'center',
tooltip: 'Download File',
handler: function(grid, rowIndex, colIndex, item, e, record) {
var recIndex = grid.getStore().indexOf(record);
console.log(recIndex);
}
}
关于javascript - Ext JS 4.2 分组中的行索引不正确,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26689922/