Overriding Extjs classes and invoking callParent

前端 未结 2 2050
广开言路
广开言路 2021-02-05 12:04

I have a few months of experience developing Extjs web application. I ran into this problem:

When I override a class, I modified the method and followed the previous imp

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-05 12:24

    You can't use callParent but you can just call the grandparent class method directly instead.

    GrandparentClass.prototype.finishedLayout.apply(this, arguments);
    

    Here's a more generic (if somewhat fragile) approach.

    this.superclass.superclass[arguments.callee.$name].apply(this, arguments);
    

提交回复
热议问题