View Full Version : Ext.Direct / Ext.Grid -- idProperty is being passed back as undefined

17 Feb 2010, 5:11 PM
This is the store:

store: new Ext.data.DirectStore({
storeId: 'registrant-activity-grid',
autoDestroy: true,
autoLoad: true,
baseParams: {personalId: this.personalId},
idProperty: 'activityId',
autoSave: true,
writer: new Ext.data.JsonWriter({
encode: false,
encodeDelete: false,
writeAllFields: true
api : {
read : Direct.Registrant.getActivities,
create : Direct.Echo.send,
destroy : Direct.Registrant.deleteActivity,
update : Direct.Echo.send
fields: [
{name: 'activityId', type: 'int'},
{name: 'activityType'},
{name: 'activityDetails'},
{name: 'notes'},
{name: 'activityDate', type: 'date'},
{name: 'personalId'},
{name: 'projectId'},
{name: 'isComplete'}

This store is backing a GridPanel.

The load works correctly, this is the POST request that the client sends to the server:


HOWEVER, I am trying to delete a row, and this is what is being POST back to the server:


My question is, why does the data being sent back to the server have a key of "undefined" instead of activityId ?

And an edit: if I change encodeDelete from false to true, this is the data that ends up being posted:


18 Feb 2010, 12:11 AM
Add 'root' config option to your data store, because default 'root' value is undefined.

I always use:

new Ext.data.DirectStore({
...: ...,
root: 'data',
...: ...


18 Feb 2010, 9:28 AM
Thanks, got it.