PDA

View Full Version : How to set successProperty of Ext.data.JsonReader from http response code



nibftpit
26 Sep 2012, 3:04 AM
Hi all,
I'm completely new to EXTJS.
I have a client javascript application based on ExtJs consuming a REST webservice talking in JSON.
Im using this example http://dev.sencha.com/deploy/ext-4.0.0/examples/restful/restful.html to implement a CRUD system.
I'd like to change the way the jsonReader check for errors in the response. I can only config the successProperty but it seems it accepts a boolean value in each case. My REST WS response is {"resultState":"ok"} or {"resultState":"error"}, so it is a string not boolean, with http status code 200. I'd like to configure(or maybe override) my JsonReader in such a way it can check for error looking at "resultState" or at least only at http response code.

loiane
26 Sep 2012, 8:50 AM
You can add you config into the msgProperty inside the reader:


messageProperty: 'resultState'