im using extjs 4.0 and am trying to combine an editable grid with a checkbox selection model.
Problem is when i click on the checkbox i get this error message
Uncaught TypeError: Object [object Object] has no method 'getEditor'
its clear to me that the checkbox column isn´t supposed to be edited (in the cellediting plugin way) so there’s no getEditor function.
i tried defining a beforeedit listener on CellEditing component that skips edition for colIdx = 0 but it doesn´t even get called because the error occurs just before this happens, on the startEditByClick method.
So, my question is, should I:
a) define a getEditor NO-OP function and bind it to the first column? i don´t know if this is even possible
b) define a listener to skip edition when colIdx = 0 that fires before the startEditByClick function gets called? on what event of what component would this be?
c) ignore javascript errors as long as it works (:P)
here´s some code
var cellEditing = Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
Ext.define('RPV.view.aviso.AvisosList', {
extend: 'Ext.grid.Panel',
store: 'AvisosStore',
selModel: Ext.create('Ext.selection.CheckboxModel'),
plugins: [cellEditing],
initComponent: function () {
this.columns = [{
header: 'NIV',
dataIndex: 'niv',
flex: 1,
editable: false
}, {
header: 'NCI',
dataIndex: 'nci',
flex: 1,
editable: false
}, {
header: 'Tipo movimiento',
dataIndex: 'tipoMovimiento',
width: 130,
field: {
xtype: 'combobox',
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: 'TipoMovimientoStore',
lazyRender: true,
listClass: 'x-combo-list-small',
mode: 'remote',
minChars: 0,
valueField: 'descripcion',
displayField: 'descripcion',
emptyText: 'No especificado'
}
}, {
header: 'Observaciones',
dataIndex: 'observacionesDwr',
width: 130,
field: {
xtype: 'combobox',
typeAhead: true,
triggerAction: 'all',
selectOnTab: true,
store: 'ObservacionesStore',
lazyRender: true,
mode: 'remote',
minChars: 0,
valueField: 'descripcion',
displayField: 'descripcion',
autoSelect: false
}
}];
this.callParent(arguments);
}
});
UPDATE: found this link http://www.sencha.com/forum/showthread.php?137731-Using-checkbox-selection-model-in-the-editable-grid-produces-an-error&highlight=CellEditing
that says this is a bug, thats already been fixed for version 4.1.0
Try this
http://www.sencha.com/forum/showthread.php?140253-Ext.grid.plugin.CellEditing-Ext.selection.CheckboxModel-TypeError