1.定义model的两种方式:
Ext.onReady(function () {
Ext.define("person",{
extend:"Ext.data.Model",
fields:[
{name:'name',type:'auto'}
]
});
var p=new person({
name:'aaaaa'
});
alert(p.get('name'))
})
2.
Ext.onReady(function () {
Ext.regModel("person",{
fields:[
{name:'name',type:'auto'}
]
});
var p=new person({
name:'test'
});
alert(p.get('name'))
})