我想在ExtJS 7的现代网格中打开一个上下文菜单,并选择右键单击的行。上下文菜单使用下面的代码。但是,我找不到选择行的方法。grid.getSelectionModel()
似乎在ExtJS 7中不再可用。
// Listener in my Ext.app.ViewController manages to update and show context menu but not to select the row.
onContextMenu: function (e) {
const grid = this.getView();
const target = e.getTarget(grid.itemSelector);
if (target) {
e.stopEvent();
const item = Ext.getCmp(target.id);
if (item) {
// Would like to select row here with something like grid.getSelectionModel().selectRow(rowindex);
this.updateMenu(item.getRecord(), item.el, e);
}
}
}
1条答案
按热度按时间zc0qhyus1#
看一下下面的小提琴示例(Modern toolkit 7.3.1)