HelloWord.js:
Ext.onReady(function(){
Ext.Loader.setConfig({enabled: true,
paths: {
My: 'resource/js/objBase' //命名空间
}
});
Ext.get("b1").on("click",function(){
alert(1);
var first = Ext.create("My.Child2",{
});
first.jump();
});
});
Child2.js:
extend:"My.Parent", //继承
config:{
c:"c",
},
mixins:{ //多继承
child:"My.Child1"
},
constructor: function(cfg) {
this.initConfig(cfg);
},
jump:function(){
alert("Child2-jump-跳崖!!!");
}
});
Child1.js:
Ext.define("My.Child1",{
extend:"My.Parent", //继承
config:{
foot:"f",
eye:"e"
},
constructor: function(cfg) {
this.initConfig(cfg);
},
jump:function(){
alert("Child1-jump-跳崖!!!");
}
});
Parent.js
Ext.define("My.Parent",{
config:{
name:"cc",
age:null
},
constructor: function(cfg) {
this.initConfig(cfg);
},
say:function(){
alert("王八蛋!!!");
}
});