Tatonka
15 Oct 2012, 12:14 AM
Hi,
I am using a REST proxy for my Ext store which seems to work well.
Ext.define('ExtApp.store.Sets', {
extend: 'Ext.data.Store',
requires: 'ExtApp.model.Set',
model: 'ExtApp.model.Set',
id: 'setsStore',
pageSize : 500,
autoLoad: true,
autoSync: false,
proxy: {
type: 'rest',
url: '/api/sets',
appendId: true,
extraParams : {'token': API_TOKEN, 'authenticity_token': AUTHENTICITY_TOKEN },
reader:{
type: 'json',
root: 'sets'
},
},
....
The problem then appears when I delete a record and sync. The first DELETE request is handled fine by the server, but apparently the action is not recognized by the Ext store. When syncing again, I get a 404 NetworkError, stating the id is no longer valid (which makes sense, since it has been deleted).
DELETE http://localhost:3000/api/sets/51?_dc=1...%3D (200 OK, 63ms)
DELETE http://localhost:3000/api/sets/51?_dc=1...%3D (404 Not Found, 25ms)
Does the store expect the server to send a specific response to recognize the success?
Thanks for the help
T.
I am using a REST proxy for my Ext store which seems to work well.
Ext.define('ExtApp.store.Sets', {
extend: 'Ext.data.Store',
requires: 'ExtApp.model.Set',
model: 'ExtApp.model.Set',
id: 'setsStore',
pageSize : 500,
autoLoad: true,
autoSync: false,
proxy: {
type: 'rest',
url: '/api/sets',
appendId: true,
extraParams : {'token': API_TOKEN, 'authenticity_token': AUTHENTICITY_TOKEN },
reader:{
type: 'json',
root: 'sets'
},
},
....
The problem then appears when I delete a record and sync. The first DELETE request is handled fine by the server, but apparently the action is not recognized by the Ext store. When syncing again, I get a 404 NetworkError, stating the id is no longer valid (which makes sense, since it has been deleted).
DELETE http://localhost:3000/api/sets/51?_dc=1...%3D (200 OK, 63ms)
DELETE http://localhost:3000/api/sets/51?_dc=1...%3D (404 Not Found, 25ms)
Does the store expect the server to send a specific response to recognize the success?
Thanks for the help
T.