Hello,
I am having this problem while working in append mode with a jsonstore.
Let's consider this store and associated grid:
Code:
var masterAssociationStore = new Ext.data.JsonStore({
proxy: new Ext.data.HttpProxy({
url: '....',
}),
baseParams: {
start: 0,
limit: thePageSize
}
});
var sm = new Ext.grid.CheckboxSelectionModel({
checkOnly: true
});
var masterGrid = new Ext.grid.GridPanel({
store: masterAssociationStore,
loadMask: true,
title: "Currently Associated Invoices",
frame: true,
height: 200,
defaults: {
sortable: true,
width: 150,
resizable: true
},
selModel: sm,
columns: [
sm, {
dataIndex: "masterInvoiceId",
header: "masterInvoiceId"
},
{
dataIndex: "masterInvoiceNumber",
header: "masterInvoiceNumber"
},
{
dataIndex: "mawbMbl",
header: "mawbMbl"
},
{
dataIndex: "hawbHbl",
header: "hawbHbl"
},
{
xtype: "datecolumn",
format: "d/m/Y",
dataIndex: "createdOn",
header: "createdOn"
}],
tbar: [{
text: 'Search',
handler: function () {
masterAssociationWin.show();
},
iconCls: 'icon-find'
}]
});
where masterAssociationWin is a window in which I have a form used for searching items to add to the grid.
This is the code I use to add records to the grid when I submit the form mentioned above:
Code:
invoiceAssociationSearchForm.getForm().submit({
waitMsg: 'Submitting data...',
success: function (form, action) {
masterAssociationStore.loadData(action.result, true);
},
failure: function (form, action) {
switch (action.failureType) {
case Ext.form.Action.CONNECT_FAILURE:
Ext.Msg.show({
title: 'Error',
msg: 'Server communication error',
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
break;
case Ext.form.Action.SERVER_INVALID:
Ext.Msg.show({
title: 'Error',
msg: action.result.message,
buttons: Ext.MessageBox.OK,
icon: Ext.MessageBox.ERROR
});
}
}
});
where invoiceAssociationSearchForm is the submitted form.
Whenever the action returns records already existing in the store, I get an error:
Code:
record is undefined
meta.value = column.re..., meta, record, rowIndex, i, store); ext-all-debug.js (row 68448)
I am using Extjs ver. 3.2.0.
I've already read about each record must having its own ID, so it could be the problem.
But any workaround to work in append mode even if there are records with the same id already in the store?
I thought the
Code:
loadData(action.result, true);
would have avoided this kind of problems...