在ExtJS 4中调用生命周期模板方法

问题描述

| 在下面的示例代码中,我创建了一个自定义组件,该组件使用了一些生命周期回调方法,例如onRender
Ext.onReady (function() {
Ext.define(\"Person\",{
    extend: \"Ext.Component\",constructor: function (config) {
        this.initConfig(config),this.callParent();
        console.log(\"inside constructor\");
        return this
    },onRender: function() {
        this.callParent(arguments);
        console.log(\"inside onRender\");
    },});

Ext.create(\'Person\',{
    width:200,height:300,html: \"hello world\",renderTo: Ext.getBody()
});
}); 输出:\“内部构造函数\” 似乎未调用生命周期方法onRender。也不会渲染“ hello world”。 我究竟做错了什么?     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)