javascript - Ext JS 4.2 分组中的行索引不正确

标签 javascript extjs grouping

我正在使用带有操作列的网格。最近我添加了分组功能。现在,如果我在我的选择上方折叠一个或多个组,我会得到不正确的行索引。即,当存在折叠组时,组内的所有行都不会计算行索引。

下面是我的操作列处理程序

{
    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/

相关文章:

javascript - HTML 表单检查空字段

javascript - 谷歌地图获取中心不返回有效的经度

javascript - 如何使用 sencha 4.1.1 清除/清空 div?

MySQL 根据第二个表中的条目对相似行进行分组

Java 流 : Replacing groupingBy and reducing by toMap

Javascript ES2015 检查对象中的命名键之一是否为空

javascript - iFrame 和匹配的侧边栏 div 高度

用于更快开发的 extjs IDE

php - Google Analytics(分析)无法在Sencha应用程序中运行

algorithm - 有效的聚类算法