日期:2014-05-16 浏览次数:20441 次
Ext.define('DynamicButtonText', {
extend: 'Ext.button.Button',
initComponent: function() {
this.text = "ss";
alert("alert in initComponent second")
this.renderTo = Ext.getBody();
},
constructor:function(){
this.text = new Date();
alert("alert in constructor first")
//如果initComponet,constructor同时存在callParent必须写在constructor中
//否则initComponet中的内容不执行
this.callParent();
},
scope:this
});
Ext.onReady(function() {
Ext.create('DynamicButtonText');
});