【发布时间】:2013-07-24 06:38:32
【问题描述】:
我定义了一个 treeGrid 与插件 CellEditing 类似
Ext.define('MyExample', {
extend: 'Ext.tree.Panel',
id: 'example',
alias: 'example',
....
plugins: [
Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1,
listeners: {
beforeedit: function(plugin, edit){
alert('don't run second time');
}
}
})
],
...
我有一个按钮,当我点击这个按钮时会调用下面的窗口(这个窗口上面有treeGrid)
Ext.create('Ext.window.Window', {
title: 'Phân xử lý',
modal:true,
height: 500
width: 500
layout: 'border',
...
item[
{
title: 'example',
region: 'center',
xtype: 'example', // that here
layout: 'fit'
}
]
一切都在第一次工作,但是当我第一次关闭窗口并单击按钮再次调用窗口时,CellEditting 仍然工作但监听器不工作?
如何解决这个问题,谢谢
编辑
请在 http://jsfiddle.net/E6Uss/ 中查看我的示例代码
在我第一次单击按钮时。一切正常
但是当我关闭示例窗口并再次打开它时,我尝试再次单击以阻止单元格,我得到一个错误,例如
如何修复这个错误?谢谢
【问题讨论】:
-
在面板的
initComponent上创建插件 -
@MMT 我尝试 init initComponent: function () {} 但错误是 (TypeError: a is undefined ext-all.js line 21) ?
-
@MMT 你能修复我的代码吗?我尝试添加 initComponent 但我认为 initComponent 不存在?
标签: extjs tree extjs4.1 treegrid