I tried to extend the Connection class, like Ext.Ajax did to get a central point where I can set some default values.
Ext.define( 'App.helper.HttpApi', {
extend : 'Ext.data.Connection',
singleton: true,
request: function( oConf ) {
oConf.url = '/index.php';
oConf.params.vers = '1.1.json';
oConf.params...
this.callParent( oConf );
}
} );
I get : “Uncaught Ext.Error: No URL specified”
But as you can see, the url IS specified… somehow it gets lost in the depth of the Ext Code.
the error which you are getting is thrown by
setOptionsmethod ofExt.data.Connectionso you need to provide url when constructor of
Ext.data.Connectionis called so all further methods can use that urlor if you are going to use single url for all the requests then you can directly specify it as default value of this singleton