日期:2014-05-16  浏览次数:20365 次

Extjs checkModel 出现异常have no method getEditor

问题描述:

http://www.sencha.com/forum/showthread.php?137731-Using-checkbox-selection-model-in-the-editable-grid-produces-an-error&highlight=CellEditing

?

解决方案:

Ext.override(Ext.grid.plugin.CellEditing, {

	startEdit: function(record, columnHeader) {
        var me = this,
            value = record.get(columnHeader.dataIndex),
            context = me.getEditingContext(record, columnHeader),
            ed;

        record = context.record;
        columnHeader = context.column;

        
        
        me.completeEdit();

        context.originalValue = context.value = value;
        if (me.beforeEdit(context) === false || me.fireEvent('beforeedit', context) === false || context.cancel) {
            return false;
        }
        
        
        if (columnHeader && (!columnHeader.getEditor || !columnHeader.getEditor(record))) {
            return false;
        }
        
        ed = me.getEditor(record, columnHeader);
        if (ed) {
            me.context = context;
            me.setActiveEditor(ed);
            me.setActiveRecord(record);
            me.setActiveColumn(columnHeader);

            
            me.editTask.delay(15, ed.startEdit, ed, [me.getCell(record, columnHeader), value]);
        } else {
            
            
            
            
            me.grid.getView().getEl(columnHeader).focus((Ext.isWebKit || Ext.isIE) ? 10 : false);
        }
        
        return true;
    }
});
?