Ext.define("Imobfusion.data.User",{
extend: "Ext.data.Model",
fields:[
{name: "name",type: "string"},
{name: "email",type: "email"},
{name: "password",type: "password"}
],
proxy: {
type: 'ajax',
api: {
read: '/user/read',
create: '/user/create',
update: '/user/update',
destroy: '/user/destroy'
},
reader: {
type: 'json'
},
writer: {
type: 'json'
}
}
});
有一种简单的方法将模型与这样的形式绑定吗?:
Ext.define('Imobfusion.window.UserForm', {
extend: 'Ext.form.Panel',
model: 'Imobfusion.data.User' //This is my need (XD)
});