migolo
23 Jan 2010, 10:14 PM
Hi again.
I configured a Direct Store with API actions, in Ext 3.0 everything was working perfectly, when I upgraded to 3.1, the "update" action isn't sending the parameters:
Here is the Request payload with version 3.1:
{"action":"Productos","method":"modificar","data":[],"type":"rpc","tid":11}And the response:
{"type":"exception","tid":11,"message":"Not enough required params specified for method: modificar on class Productos"}In version 3.0.0 the Request payload is:
{"action":"Productos","method":"modificar","data":["3","{\"id\":\"3\",\"nombre\":\"Tangram 1, aktuell Lektion 5-8\",\"precio\":481,\"cantidad\":\"5\"}"],"type":"rpc","tid":10}
And the response is:
{"type":"rpc","tid":10,"action":"Productos","method":"modificar","result":{"id":"3","nombre":"Tangram 1, aktuell Lektion 5-8","precio":481,"cantidad":5}}
I am using the same application only testing with the newer version, this is how I configured the store and was working in version 3.0.0 and isn't in 3.1
var productos_writer = new Ext.data.JsonWriter({
writeAllFields: true // write all fields, not just those that changed
});
Productos = new Ext.data.DirectStore({
api: {
read: Migolo.Productos.listar,
update: Migolo.Productos.modificar
},
paramOrder: ['buscar','start'],
baseParams: {
buscar: ""
},
autoLoad: true,
root: "data",
reader: new Ext.data.JsonReader({
totalProperty: 'totalCount',
idProperty: 'id',
root: 'data'
}, [{
name: 'id',
mapping: 'id'
},{
name: 'nombre',
mapping: 'nombre'
},{
name: 'precio',
mapping: 'precio'
},{
name: 'cantidad',
mapping: 'cantidad'
}]),
writer: productos_writer
});
I must say that the "read" action is working in both versions sending the right params.
Best regards, and sorry for my English.
Miguel González
I configured a Direct Store with API actions, in Ext 3.0 everything was working perfectly, when I upgraded to 3.1, the "update" action isn't sending the parameters:
Here is the Request payload with version 3.1:
{"action":"Productos","method":"modificar","data":[],"type":"rpc","tid":11}And the response:
{"type":"exception","tid":11,"message":"Not enough required params specified for method: modificar on class Productos"}In version 3.0.0 the Request payload is:
{"action":"Productos","method":"modificar","data":["3","{\"id\":\"3\",\"nombre\":\"Tangram 1, aktuell Lektion 5-8\",\"precio\":481,\"cantidad\":\"5\"}"],"type":"rpc","tid":10}
And the response is:
{"type":"rpc","tid":10,"action":"Productos","method":"modificar","result":{"id":"3","nombre":"Tangram 1, aktuell Lektion 5-8","precio":481,"cantidad":5}}
I am using the same application only testing with the newer version, this is how I configured the store and was working in version 3.0.0 and isn't in 3.1
var productos_writer = new Ext.data.JsonWriter({
writeAllFields: true // write all fields, not just those that changed
});
Productos = new Ext.data.DirectStore({
api: {
read: Migolo.Productos.listar,
update: Migolo.Productos.modificar
},
paramOrder: ['buscar','start'],
baseParams: {
buscar: ""
},
autoLoad: true,
root: "data",
reader: new Ext.data.JsonReader({
totalProperty: 'totalCount',
idProperty: 'id',
root: 'data'
}, [{
name: 'id',
mapping: 'id'
},{
name: 'nombre',
mapping: 'nombre'
},{
name: 'precio',
mapping: 'precio'
},{
name: 'cantidad',
mapping: 'cantidad'
}]),
writer: productos_writer
});
I must say that the "read" action is working in both versions sending the right params.
Best regards, and sorry for my English.
Miguel González