我是Extjs的新手,正在使用Extjs3.2网格RowEditor。我想要一旦我们单击添加员工按钮,编辑器窗口就会弹出,当我们单击取消编辑器时,窗口会关闭,但行会添加到网格中。我想要如果我们单击取消,它会返回到初始状态而没有新行
http://dev.sencha.com/deploy/ext-4.0.0/examples/grid/row-editing.html
如何阻止这个?
谢谢
为RowEditing插件添加一个“ canceledit”侦听器,并编写可接受的逻辑。
例如,我写了:
var rowEditing = Ext.create('Ext.grid.plugin.RowEditing', {
clicksToMoveEditor: 1,
autoCancel: false,
listeners: {
canceledit: function(editor, context) {
if(context.rowIdx == 0 && context.value == "New Guy") {
store.remove(context.record);
}
}
}
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句