I am using extjs in a monorail application. I am using a JsonStore to persist data back to my controller. I have read, update and delete working properly. But I cannot seem to figure out how to format my response back on creates. Currently, Firebug gives me the following error:
uncaught exception: Ext.data.DataReader: #realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.
I am flummoxed about WTF this error means. Anyone have pointers? Relevant bits of code below:
var proxy = new Ext.data.HttpProxy({
api: {
read: '../foo/bar.rnr',
create: '../foo/CreateBar.rnr',
update: '../foo/UpdateBar.rnr',
destroy: '../foo/DeleteBar.rnr'
}
});
var writer = new Ext.data.JsonWriter({
encode: true,
writeAllFields: true,
listful: true,
destroyRecord: function(rec) {
return this.toHash(rec);
}
});
var store = new Ext.data.JsonStore({
autoLoad: true,
autoSave: false,
url: '../foo/bar.rnr',
method: 'get',
baseParams: { Id: pageParameters.Id },
proxy: proxy,
writer: writer,
id: 'Id',
fields: [
{ name: 'Id', type: 'int' },
{ name: 'Name', type: 'string' },
{ name: 'Note', type: 'string', defaultValue: null }
]
});
My current response looks like this, but this is after a lot of trial and error, so it is prolly hosed.
{"success":true,"message":"OK!","undefined":[]}