0

我有一个网格,它有一个选择模型,它只允许在某些条件下选择一行。

当我单击一行时,它会聚焦(它变成深灰色)。我想添加一个按钮,作用于当前关注的行。

由于选择已停用,我无法使用正常方式

grid.getSelectionModel().getSelection()

因为没有选择。如何访问重点行?

4

1 回答 1

3

将此侦听器添加到您的网格以获取有关焦点行的信息。

Ext.create('Ext.grid.Panel', {
    ...
    listeners: {
        afterrender: function(component){
            component.getSelectionModel().on({
                focuschange: function (view, oldFocused, newFocused, eOpts) {
                    console.log(newFocused);
                }
            });
        }
    }
});
于 2014-10-30T16:24:53.343 回答