为什么是this.callParent(arguments);在ExtJS中的构造函数的开头调用? [英] why is this.callParent(arguments); called at the beginning of the constructors in ExtJS?
本文介绍了为什么是this.callParent(arguments);在ExtJS中的构造函数的开头调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
这是ExtJS使用的机制在构造函数中支持类继承。在构造函数中调用 this.callParent(arguments)
调用正在扩展的直接父类的构造函数。
I noticed that in a lot of the programs I have been modifying recently they always call the parent arguments of the current object. I know that this is needed but don't have a solid understanding as to why this is a common practice. Any wisdom out there for a junior level developer... I should know this.
解决方案
This is the mechanism that ExtJS uses to support class inheritance in constructors. Calling this.callParent(arguments)
in a constructor calls the constructor of the immediate parent class that's being extended.
这篇关于为什么是this.callParent(arguments);在ExtJS中的构造函数的开头调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文