tags:

views:

58

answers:

1

Hello,

I am using EXT-JS 3.2.0 and I have an Ext.grid.EditorGridPanel backed by a Ext.data.Store object. The store has the restful flag on and uses Ext.data.JsonReader and Ext.data.JsonWriter. It works great for retrieving data and populating the grid. However, when I add or update a record, the JSON produced for the POST/PUT has the data nested under a root field. This is not matching up with what the service I am calling expects. It wants a flat object. For example, when I add or update a record, the JSON produces looks something like this:

{
   "data":  {
      "name": "TEST",
      "id": "-1"
   }
}

But I need it to be

{
   "name": "TEST",
   "id": "-1"
}

Any ideas?

Thanks,

John

A: 

I don't know if it's the best approach but I ended up creating my own Ext.data.Connection object and making the request where I needed it, for example on the delete. Not the solution I was hoping for but it works.

John in MD