【问题标题】:Extjs4 this.callParent in ExtJs3ExtJs3 中的 Extjs4 this.callParent
【发布时间】:2017-10-05 07:08:14
【问题描述】:

我是使用 extjs 的新手。 ExtJs3 中 this.callParent(args) 的等价物是什么。它在 extjs4 中有效,但在 extjs 3 中无效。感谢您的帮助

【问题讨论】:

  • 你可以试试这个-YourComponent.superclass.initComponent.apply(this, arguments); PS:它没有经过测试。请粘贴这将有帮助。
  • 嗨。感谢您的建议,但它返回错误“无法读取未定义的属性'应用'”
  • 你收到YourComponent.superclass.initComponent这么多吗?请粘贴一些代码

标签: extjs extjs4 extjs3


【解决方案1】:

在 Ext JS 3x 中,我们使用superclass 属性来调用父类方法。例如,要调用Ext.Component 的父类构造函数,请使用:

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

另一个例子:

要调用 TabPanel 父类的initComponent() 方法,你可以这样写:

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

希望这对你有用。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-08-09
    • 1970-01-01
    • 2012-10-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多