Ext.onReady(function(){
/**
* test1,声明一个类,定义类中的方法
*/
Ext.define("demo.Demo",{
name:'Logo',
hello:function(){
Ext.MessageBox.alert("打招呼","大家好啊,我是.....");
}
});
var de=new demo.Demo();
de.hello();
/**
* test2,声明一个类,继承与别的类
*/
Ext.define("demo.MyWin",{
extend:'Ext.Window',
title:'我的窗口',
width:300,
height:200,
html:'Hello World ,I am ExtJs'
});
var win=new demo.MyWin();
win.show();
/**
* test3 多重继承 mixins:[](混入)
*/
Ext.define("demo.DemoPanel",{
extend:'Ext.Window',
mixins:['demo.Demo']
});
var p=new demo.DemoPanel();
p.hello();
/**
* test4 config熟悉自动添加getter,setter方法
*/
Ext.define("demo.DemoInstance",{
config:{
title:'DemoInstance'
}
});
var instance=new demo.DemoInstance();
instance.setTitle("my title");
Alert(Instance.Gettitle());
});