- render : function(action, rs, params, data) {
- Ext.apply(params, data);
-
- if (this.encode === true) { // <-- @deprecated returnJson
- if (Ext.isArray(rs) && data[this.meta.idProperty]) {
- params[this.meta.idProperty] = Ext.encode(params[this.meta.idProperty]);
- }
- params[this.meta.root] = Ext.encode(params[this.meta.root]);
+ render : function(params, baseParams, data) {
+ if (this.encode === true) {
+ // Encode here now.
+ Ext.apply(params, baseParams);
+ params[this.meta.root] = Ext.encode(data);
+ } else {
+ // defer encoding for some other layer, probably in {@link Ext.Ajax#request}. Place everything into "jsonData" key.
+ var jdata = Ext.apply({}, baseParams);
+ jdata[this.meta.root] = data;
+ params.jsonData = jdata;