Trying to use buildURL to customise the url for a REST proxy on a local model. The GET/POST/PUT requests have different urls in my API so when I try to customise the url via buildUrl I get the following error:
Uncaught Error: Cannot override method buildUrl on Ext.data.proxy.Rest instance.
However the documentation for the REST proxy says I should be able to override it:
My model is something like this:If further customization is needed, simply implement the buildUrl method and add your custom generated url onto the Ext.data.Request object that is passed to buildUrl. See Rest proxy's implementation for an example of how to achieve this.
Ext.define('Todo', {
extend: 'Ext.data.Model',
proxy: {
type: 'rest',
url : URL,
buildUrl:function(request){
// THIS IS WHERE I AM TRYING TO CUSTOMISE THE URL
// TO BE DIFFERENT FOR EACH CRUD REQUEST
return this.callParent(request);
}
});