首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

extjs 四 initComponent

2012-11-23 
extjs 4 initComponent?initComponent 和constructor 的参数问题??initComponent 可以取得constructor 中

extjs 4 initComponent?

initComponent 和constructor 的参数问题?

?

initComponent 可以取得constructor 中的参数吗?怎样取得? 2012-3-15

?

例证:

?
    <script type="text/javascript">    //    Ext.define('Desktop',{       extend:'Ext.panel.Panel',       app:null,       initComponent:function(){? ? ? ? ? ? ? alert('app='+this.app); //注意此处 this.app 是 App 而不是null       }    });    //    Ext.define('App',{        constructor:function(){      var me=this;      desktopCfg=me.getDesktopConfig();      new Desktop(desktopCfg);    },    getDesktopConfig:function(){      var me=this,      cfg={        app:me      }      return cfg;    }    });        Ext.onReady(function(){        new App();    })    </script>

热点排行