I have a grid panel with JSON store, if I give alert (myGrid.model.prototype.fields.keys), it is showing all fields name ending with id, for example if I have two fields a1, a2, in alert it is showing as (‘a1′,’a2′,’id’). I don’t know how this Id is getting appended to the fields. If I do the same in extjs4.0.2, it’s working fine, but with extjs 4.1.0 it’s showing this problem.
Sample code is:
tbar : [{
text : 'Save',
height : 20,
handler : function(){
var gridColumnIds = component.gridStore1.model.prototype.fields.keys;
// alert(grid1.columns[0].dataIndex)
// console.log(gridColumnIds);
alert("grid ids :"+gridColumnIds);
var gridData = Ext.encode(Ext.pluck(component.gridStore1.data.items,'data'));
alert("grid data is :"+gridData);
}
},{
text : 'Get Record',
height : 20,
handler : function(){
p1.show();
}
}]
Probably it’s caused because you used Model with default idProperty value (idProperty == ‘id’ by default). Try change this property http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.Model-cfg-idProperty.