1
我已经阅读了Sencha教程,API和论坛一段时间,但碰到了一面砖墙。我有一个存储Web应用程序数据的mySQL/PHP后端。我有以下Sench/ExtJS的构建:将商店更新写回服务器
App.stores.user = new Ext.data.Store({
model: 'User',
proxy: new Ext.data.AjaxProxy({
url: 'app/stores/scripts/connect.php',
extraParams: {
method:'user',
user_id: 3
},
reader: {
type:'json',
root:'root'
}
}),
autoLoad:true
});
数据加载到店很好,但我有直接更新一个用户实例的形式。
App.controllers.account = new Ext.Controller({
save: function (options) {
options.user.set(options.data);
options.user.save(); // Generates error: Uncaught Error: You are using a ServerProxy but have not supplied it with a url.
}
});
我怎样才能成功地实现/挂钩函数写脏记录回服务器?请求如何准备并通过?
谢谢。
如何为商店指定HttpProxy对象? – Mark