PDA

View Full Version : Can EditorGrid and CheckBoxModel work together?



christophercheng
9 Jan 2012, 7:51 AM
I found out that if I mix CheckboxModel and EditorGrid together, it will produce the following errors



ext-all-debug.js (Line 83219)

columnHeader.getEditor is not a function
if (columnHeader && !columnHeader.getEditor(record)) {


The following is an example



Ext.define('MyGridPanel', {
extend: 'Ext.grid.Panel',
alias: 'widget.myGridPanel',
title: 'Air',
store: new Ext.data.Store({
fields: ['productId', 'name', 'amount'],
proxy: {
type: 'memory',
reader: {
type: 'json',
root: 'data'
}
}
}),
columns: [
{ header: 'productId', dataIndex: 'productId', hidden: true},
{ header: 'name', dataIndex: 'name', flex: 1 },
{
header: 'Amount',
dataIndex: 'amount',
editor: {
xtype: 'numberfield',
allowNegative: false,
minValue: 0.00
},
renderer: function(value, metaData, record, rowIndex, colIndex, store, view){
return Ext.util.Format.number(value, "0.00");
}
}
],
selModel: new Ext.selection.CheckboxModel({
mode: 'MULTI'
})
,selType: 'checkboxmodel'
,multiSelect: true
,plugins: []
,constructor: function(config) {
this.plugins[0] = new Ext.create('Ext.grid.plugin.CellEditing', {
clicksToEdit: 1
});
this.callParent(arguments);
}
});

mitchellsimoens
9 Jan 2012, 10:48 AM
There is a bug reported about using these two together.

christophercheng
18 Jan 2012, 4:06 AM
oops. I am using 4.0.7. Will this be fixed in 4.0.8?