想要显示弹出窗口(例如。是否要保存更改?将选择上一行,直到用户将其保存为止,如果此时单击“否”,则删除上一行的更改并选择下一行。
如果使用Ext.grid.plugin.CellEditing
编辑行。
您需要侦听beforeedit事件,并与Ext.Msg.confirm
结合使用以提交/拒绝更改以进行提示。
赞:
plugins: [{
ptype: 'cellediting',
listeners: {
beforeedit: function (editor, context) {
Ext.Msg.confirm("Confirmation", "Confirm to save",
function (btn) {
if (btn === "yes") {
context.record.commit();
} else {
context.record.reject()
}
});
}
}
}]