ExtJS4中initComponent和constructor的区别
2014-06-11 21:19
204 查看
Ext的define方法参数类型define( String className, Object data, Function createdFn ) 创建自定义类时,先构造(constructor)后初始化(initComponent)。如: Ext.define('Btn',{ extend:'Ext.button.Button', initComponent:function(){ this.callParent(); //一定要有这句 alert('后初始化部件启动...'); }, constructor:function(){ this.text = new Date(); this.renderTo = Ext.getBody(); this.callParent(); alert('先构造函数启动...'); } }); Ext.onReady(function(){ Ext.create('Btn'); });
相关文章推荐
- ExtJS4中initComponent和constructor的区别
- combo 添加listeners,使用 initComponent、constructor 的区别
- [Ext JS 4] Extjs 之 initComponent 和 constructor的区别
- [Ext JS 4] Extjs 之 initComponent 和 constructor的区别
- Extjs4 initComponent 和 constructor 的一点题目
- Ext组件化编程是用initcomponent还是constructor
- Angular2中constructor与ngOninit的区别
- Angular 的 ngOnInit 和 Constructor 的区别
- Angular中Constructor 和 ngOnInit 的本质区别
- Angular 的 ngOnInit 和 Constructor 的区别!
- initComponent还是constructor
- ngOnInit与constructor的区别
- Angular中Constructor 和 ngOnInit 的本质区别
- page_load 与page_init 的区别
- WinForm中Component Class、User Control及Custom Control的区别和使用
- context-param和init-param区别
- js中escape,encodeURI,encodeURIComponent三个函数的区别