somebee
13 May 2009, 10:43 PM
What is the reason for needing to return only the records themselves (at root-level) in DirectStore (probably all writer-capable stores in general)?
When I update a record in my store, Direct expects a returnvalue like: {id: 3, title: "Test"}. Would it not be better to follow the convention in rest if Ext, with something like:
{success: true, data: {id: 3, title: "Test"}, errors: {...}}
I use the same actions server-side to save forms (for records) and save records in grids. But for forms you need to supply a success: true (for callback etc).
And how would you tell the store about errors on create/update(?) When I try to return {success: true, data: {id: 3, title: "Test"}} to my DirectStore with configured reader/writer (with root: 'data', idProperty: 'id' etc) I get:
Ext.data.DataReader: #realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.
When I update a record in my store, Direct expects a returnvalue like: {id: 3, title: "Test"}. Would it not be better to follow the convention in rest if Ext, with something like:
{success: true, data: {id: 3, title: "Test"}, errors: {...}}
I use the same actions server-side to save forms (for records) and save records in grids. But for forms you need to supply a success: true (for callback etc).
And how would you tell the store about errors on create/update(?) When I try to return {success: true, data: {id: 3, title: "Test"}} to my DirectStore with configured reader/writer (with root: 'data', idProperty: 'id' etc) I get:
Ext.data.DataReader: #realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.