0
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 2,
listeners: {
'beforeedit': function (rowIdx, colIdx) {
},
'validateedit': function (editor, e) {
}
我已經創建了一個像上面這樣的單元格編輯插件,並將其附加到我的網格中。
var grid = Ext.create('Ext.grid.Panel', {
width: width,
height: height,
frame: true,
plugins: [cellEditing]
問題是當我用Ext.getCmp('GridId')。銷燬我的網格。該插件的聽衆正在被刪除。我能做些什麼來重新配置插件,就像以前一樣?
這並不回答你的問題,但是這是一個與你在銷燬並重新創建網格面板後可能遇到的奇怪場景相關的參考。在我們重新創建網格面板後,我們遇到了很多問題,網格面板在編輯單元格時會消失..發現網格面板銷燬並不總是破壞監聽器,我們的解決方案是上到容器級別並使用remove [ http://docs.sencha.com/extjs/4.2.3/#!/api/Ext.container.Container-method-remove]針對網格面板,刪除遍歷到網格面板並正確地移除了聽衆。 – user2574678