我正在使用Ignite UI 网格。当特定编辑器专注于新行插入或更新时,我必须打开一个对话框。编辑模式是“行”。
我能够打开对话框,我为此使用了editCellStarted事件并将编辑器绑定到焦点事件。代码如下:
$("#Grid").igGrid({
primaryKey: "keyCode",
autoCommit: true,
columns: _getColumnsResult,
features: [
{
name: 'Updating',
columnSettings: updateColSettings,
editMode: 'row',
editCellStarted: function (evt, ui) {
if(ui.columnKey=="Demo")
{
$("#" + ui.columnkey + " input").bind('focus', { id: ui.columnIndex}, function (e) {
$("dialog1").dialog();
});
}
},
}, //Updating feature ended
{
name: "Sorting",
type: "local",
},
{
name: "Selection",
mode: "row",
rowSelectionChanged: function (evt, ui) { Selectedrow = ui.row.index }
}]
});
问题: 单击添加新时,如果该特定列是第一列,则焦点转到对话框并返回到编辑器。焦点不会保留在对话框中。
但如果该列不是第一列,则代码工作正常。
请帮助完成此任务。提前致谢。
这是它的小提琴。