-
5 May 2009 4:26 AM #1
[SOLVED] [3.0rc1.1] Writer problem
[SOLVED] [3.0rc1.1] Writer problem
Hi,
I'm new to Ext.. I wrote the following code:
When I update the row with the writer I send from the server this:Code:store = new Ext.data.Store({ url: "-----.php", baseParams: {limit:100}, remoteSort: true, reader: new Ext.data.JsonReader({ totalProperty: "totalCount", root: "records", idProperty: "id", successProperty: "success" },Keyword ), writer: new Ext.data.JsonWriter({ returnJson: true, writeAllFields: false },Keyword ) }),
But I have this error:Code:{"success":true}
DataReader#update received invalid data from server. Please see docs for DataReader#update
what's wrong?? Thanks
Andrea
-
5 May 2009 4:40 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 40
A writer update should return an object with the new record values.
-
5 May 2009 5:07 AM #3
solved returning this:
thanks!Code:{"success":true,"records":{"id":"2694",....}}
-
11 May 2009 12:10 PM #4
Andrea, you don't have to return the entire record but you must return at least the id. The DataReader will merge any incoming new data from server with existing data on the record. However, I think it's always a good idea for the server to re-assert its authority over the data on the client.
Quite often, one might have a grid with an "Updated at" column. You'd want that column to be refreshed after each update. See thumb./**
* @author Chris Scott
* @business www.transistorsoft.com
* @rate $120USD / hr; training $500USD / day / developer (5 dev min)
*
* @SenchaDevs http://senchadevs.com/developers/transistor-software
* @twitter http://twitter.com/#!/christocracy
* @github https://github.com/christocracy
*/


Reply With Quote