关于ExtJS-4.0.2a中在gridpanel中出现column.getEditor is not a function的错误解决方法

本文介绍了解决在ExtJS-4.0.2a中gridpanel同时使用CellEditing插件和CheckboxModel时出现的column.getEditorisnotafunction错误的方法。提供了三种解决方案:Ext.override方法、事件监听方法和修改点击编辑属性值的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在ExtJS-4.0.2a中在gridpanel中同时使用Ext.grid.plugin.CellEditing和Ext.selection.CheckboxModel 出现column.getEditor is not a function的错误解决方法有三种:
方法一:(转载自http://www.sencha.com/forum/showthread.php?140253-Ext.grid.plugin.CellEditing-Ext.selection.CheckboxModel-TypeError
 
Ext.override(Ext.grid.plugin.CellEditing, {
     startEdit: function(record, columnHeader) {
     if (columnHeader && columnHeader.isCheckerHd) {
                return false; 
    } 
    return this.callOverridden(arguments);
}});
 
方法二:(转载自http://www.sencha.com/forum/showthread.php?140253-Ext.grid.plugin.CellEditing-Ext.selection.CheckboxModel-TypeError
solve the problem by running the following function when the "beforeedit" event occurs: 
onBeforeEditCell : function(event) {        
    if (event.column && event.column.isCheckerHd) {
        return false;
    } 
    return true;
}
方法三:(转载自http://www.sencha.com/forum/showthread.php?152014-4.0.2a-Grid-selModel-and-Editing-Bug
I think this may due to clicksToEdit property. and the checkbox column does not have a getEditor property. when click that checkbox, the editor think that column should give it a edit view. So error rise.

If you change clicksToEdit to 2 or larger, everything is OK.

It's not effect using in FF, Chrome and IE9. But IE7 will refuse to run the rest script, so that mean you cannot select more than one row in grid.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值