PDA

View Full Version : Ext.data.proxy.Ajax issue



nferreira
16 Dec 2012, 7:33 PM
Hi All,

I have a Model and I have configured a Ajax proxy to handle its remote operations.

Code fragment from the model:



...
proxy: {
type: 'ajax',
url: 'services/timeband.php?action=delete',
reader: {
root: 'timebands',
totalProperty: 'total'
},
api: {
create: 'services/timeband.php?action=create',
read: 'services/timeband.php?action=read',
update: 'services/timeband.php?action=update',
delete: 'services/timeband.php?action=delete',
}
},
...


Initially, I have not used a url property as I wanted to define specific url for all specific APIs.

The create, read and update work just fine, but when I try to delete a record, it raises an error stating that I can not do it without defining the url property.

Therefore, I have set the url just to handle the delete operation.

What is wrong?

Regards
Nad

evant
16 Dec 2012, 7:39 PM
Delete is a keyword in JS, we use "destroy" for that parameter.

See: http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.proxy.Server-cfg-api

nferreira
16 Dec 2012, 7:47 PM
Ops! Sorry, my mistake! Now it is working.

Thanks,
Nad