How do I call superclass fucntion in ExtJS? I am overriding a method isChildGridValid in ModelFormPanel and would like to call the base implementation of this method before customizing.
If you're using Ext.extend
, you can call the superclass function using the following pattern:
// pattern
<YourClass>.superclass.<Function>.apply(this, arguments);
// example
One.model.ModelFormContainer.superclass.getCurrentPage.apply(this, arguments);
Your case is special, though, because you don't have a class that directly extends One.model.ModelFormPanel
(you're probably extending One.model.ModelFormContainer
and modifying the config for the panel using one of the config objects). This also happens when you use Ext.override
, so you have to use the following:
// pattern
<Superclass>.prototype.<Function>.apply(this, arguments);
// example
One.model.ModelFormPanel.prototype.isChildGridValid.apply(this, arguments);
One.model.ModelFormPanel.superclass.isChildGridValid.call(this, arguments);