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

来源:互联网 发布:百乐官方淘宝授权店 编辑:程序博客网 时间:2024/05/02 01:33
在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.