Hi i’ve been getting this error message for a while now and i’d like to know what am i missing. Thanks in advance.
This is the model:
Ext.define('Recepcion',{
extend: 'Ext.data.Model',
fields: [
{name: 'obra_social_id', type: 'string'},
(... etc)
]
});
This is the Store:
//the first line is the array supposed to contain the data?
var datosPlanillaRecepcion= [];
var storePlanillaRecepcion = Ext.create('Ext.data.Store', {
model: 'Recepcion',
data: datosPlanillaRecepcion,
proxy: { type: 'memory'},
autoSync:true
});
And finally the grid bound to the store
planillaRecepcionGrid = Ext.create('Ext.grid.Panel', {
id:'gridRecepcion',
store: storePlanillaRecepcion,
flex:0.7,
height:600,
autoScroll:true,
selType: 'cellmodel',
plugins: [cellEditing],
columns: [
columnaOS = Ext.create('Ext.grid.column.Column', {
text : 'Obra Social',
flex : 0.5,
sortable : false,
dataIndex: 'obra_social',
renderer: function(value){
//return pasarMayusculas(value);
return value;
},
editor: {
allowblank: false
//clicksToEdit : 1
}
}),
columnaTotal = Ext.create('Ext.grid.column.Column',{
text : 'Total',
flex : 0.2,
sortable : false,
dataIndex: 'obra_social_recepcion_cantidad_total',
value : ' ',
editor: {
type:'numberfield',
allowblank: false,
minValue: 0,
maxValue: 1000000
},
renderer: function(value){
if (value==0)
return '';
else
return value;
},
listeners:{
validateedit: function(){
return true;
}
}
}),
(...)
{
xtype: 'actioncolumn',
width: 50,
items: [{
tooltip: 'remove',
handler: function(grid, rowIndex, colIndex) {
var rec = grid.getStore().getAt(rowIndex);
grid.getStore().remove(rec);
}
}]
}],
viewConfig: {
stripeRows: false,
border: 25,
markDirty:false,
listeners: listenersGridRecepciones
}
});
as you see i use the Cell Editing Plug-in to fill the grid with data.
I do this by programatically adding rows to the grid this way
grid.getStore().add({});
adding emtpy objects and the editing them with the mentioned plug in
the thing is that when i click on the action column it throws me the
‘o is undefined’ error and a line number pointing to the following function
getKey : function(o){
return o.id;
},
wich by the way belongs to Ext.util.AbstractMixedCollection
what can it be?, i know! “is a pain in the ass” question but perhaps i’m missing something really simple
Thanks!
how to fix