View Full Version : Update w/ RESTful Datastore

1 Jul 2009, 2:48 PM
I am trying to implement the RESTful Datastore and a grid. So far, I have been able to wire up the Get and Delete; however, the Update does not seem to be working. I have attached Fiddler to review the session... the only thing that stands out is the 'undefined' var in the querystring. Below is the raw request and the code I am using to create the Datastore / Proxy.

Thanks in advance!

PUT /service/inventoryservice.svc/inventory/automobiles/2 HTTP/1.1
Host: localhost:1244
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv: Gecko/2009021910 Firefox/3.0.7 (.NET CLR 3.5.30729)
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
X-Requested-With: XMLHttpRequest
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Referer: http://localhost:1244/Default.aspx
Content-Length: 89


// Create a standard HttpProxy instance.
var proxy = new Ext.data.HttpProxy({
url: 'http://localhost:1244/service/inventoryservice.svc/inventory/automobiles'

// Typical JsonReader. Notice additional meta-data params for defining the core attributes of your json-response
var reader = new Ext.data.JsonReader({
idProperty: 'AutomobileID'
{ name: 'AutomobileID' },
{ name: 'Make', allowBlank: false },
{ name: 'Model', allowBlank: false }

// The new DataWriter component.
var writer = new Ext.data.JsonWriter();

// Typical Store collecting the Proxy, Reader and Writer together.
var store = new Ext.data.Store({
id: 'Automobile',
restful: true, // <-- This Store is RESTful
proxy: proxy,
reader: reader,
writer: writer, // <-- plug a DataWriter into the store just as you would a Reader
listeners: {
write: function(store, action, result, response, rs) {
//App.setAlert(response.success, response.message);