So I'm a newbie for ExtJS and trying to do some integration with microsoft's OData services.
I basically extended a JsonReader that would read the "oddly formatted" JSON that the OData service is returning, I'm creating records in the reader and returning it in readRecords().... By doing that, I was able to see the data coming from the service in my Grid, so far so good!
Now the writing back was a bit of an issue, I assumed that by putting in a JsonWriter to the store, that it will magically compose the JSON string as a post action to the service. But for some reason I was checking the post parameters via firebug, and it was something like this
undefined {}
The URL is exactly what I defined, so it's acting as expected, but it's not gathering the values and composing the JSON parameters!
The JSON Writer I defined is as follow
Code:
var writer = new Ext.data.JsonWriter({
encode: true,
writeAllFields: false
});
I guess my question would be, would it be possible I screwed up something with extending the JsonReader? Or are they not related? And what would cause such a behavior?
If my question is too vague, I would love to debug this myself, but I guess I would like to know where to start from? What would be the function that composes the parameters for JSON Requests in the JsonWriter?
Thank you in advance!
-----
I was actually just debugging this, and I noticed that during the Ajax request composing, it's treating the update as a creation! I found out that for some reason the records phantom property is set to true, therefore it's trying to make a create request rather than an update one. Does that ring a bell?