View Full Version : JsonWriter.rootProperty ignored for single records

8 Aug 2012, 5:00 PM

I have set my MyApp.model.User.proxy.writer.root property to 'data'.

This root property is correctly used when I save data using a store, but when I save data using rec.save() the data is send without the wrapping root value. Is this a bug or do I have to configure something else as well?


8 Aug 2012, 6:15 PM
What does your json data look like when you call rec.save()? BTW, which Ext version do you use?

With Ext 4.1.1, when you config 'root' property for json writer, it will be used for all writing actions with single record and multiple records. There is one thing to mention here is that if you config your json writer with allowSingle set to true (which is default) and if there is only one record, data will be sent as single object instead of an array of objects.

8 Aug 2012, 6:47 PM
Thanks for the fast reply!

You brought me on the right track. I have some shared code and the problem was that ExtJS writer config is named "root" while the Sencha Touch writer config is named "rootProperty" and I had only the "rootProperty" config on my writer.

Problem solved :)