2017-10-05 96 views
0

我是使用extjs的新手。 ExtJs3中的this.callParent(args)相當於什麼。它適用於extjs4但不適用於extjs 3.感謝您的幫助Extjs4 this.callParent in ExtJs3

+0

你可以試試這個 - 'YourComponent.superclass.initComponent.apply(this,arguments);'PS:它沒有經過測試。請粘貼哪些將是有益的。 – UDID

+0

嗨。感謝您的建議,但它返回錯誤「無法讀取屬性'應用'未定義」 –

+0

您是否獲得'YourComponent.superclass.initComponent'這麼多?請粘貼一些代碼 – UDID

回答

0

在Ext JS 3x中,我們使用superclass屬性來調用父類方法。例如,調用Ext.Component父類的構造函數使用:

Ext.Component.superclass.constructor.call(this);

又如:

要調用的TabPanel父類的initComponent()方法,你寫的:

Ext.TabPanel.superclass.initComponent.call(this);

希望這對你有用。