Gr3yh0und
22 Jan 2012, 2:16 PM
Hey,
I'm just trying to rewrite my hardcoded proxies with a new class. So far i got:
Ext.define('Application.ProxyAjax', {
extend: 'Ext.data.proxy.Ajax',
alias: 'widget.teststore',
autoSave: true,
constructor: function() {
this.url = 'config/api_mysql.php';
this.api = {
read: 'config/api_mysql.php?do=read',
update: 'config/api_mysql.php?do=update',
create: 'config/api_mysql.php?do=create',
destroy: 'config/api_mysql.php?do=destroy'
};
this.actionMethods = {
read: 'POST',
update: 'POST',
create: 'POST',
destroy: 'POST'
};
this.reader = {
type: 'json',
model: 'Open',
root: 'results',
totalProperty: 'total',
idProperty: 'id'
};
this.writer = {
type: 'json',
model: 'Open',
root: 'results',
encode: 'true'
};
this.callParent();
}
});
var proxy_open = Ext.create('Application.ProxyAjax');
//proxy_open.api.read = 'config/api_mysql.php?do=read';
Now when I check the "api" value with firebug its just nothing in it. It actually also doesn't load anything... when I set the api from outside it is working (as last line up there is showing).
Any ideas why it isn't working?
I'm just trying to rewrite my hardcoded proxies with a new class. So far i got:
Ext.define('Application.ProxyAjax', {
extend: 'Ext.data.proxy.Ajax',
alias: 'widget.teststore',
autoSave: true,
constructor: function() {
this.url = 'config/api_mysql.php';
this.api = {
read: 'config/api_mysql.php?do=read',
update: 'config/api_mysql.php?do=update',
create: 'config/api_mysql.php?do=create',
destroy: 'config/api_mysql.php?do=destroy'
};
this.actionMethods = {
read: 'POST',
update: 'POST',
create: 'POST',
destroy: 'POST'
};
this.reader = {
type: 'json',
model: 'Open',
root: 'results',
totalProperty: 'total',
idProperty: 'id'
};
this.writer = {
type: 'json',
model: 'Open',
root: 'results',
encode: 'true'
};
this.callParent();
}
});
var proxy_open = Ext.create('Application.ProxyAjax');
//proxy_open.api.read = 'config/api_mysql.php?do=read';
Now when I check the "api" value with firebug its just nothing in it. It actually also doesn't load anything... when I set the api from outside it is working (as last line up there is showing).
Any ideas why it isn't working?