Suppose there is a component:

Ext.define('Person', { initComponent : function(){ }, getPerson : function(){ console.log('get Person'); } }); 

And its extension:

 Ext.define('Student', { extend : 'Person', initComponent : function(){ //call parent class constructor this.callParent(arguments); }, getStudent: function(){ console.log('get Student') } }); 

I need to do so that after the getPerson method is getPerson , the getPerson method is always executed.

    1 answer 1

    You can try to override getPerson . For example:

     Ext.define('Student', { extend : 'Person', initComponent : function(){ //call parent class constructor this.callParent(arguments); }, getPerson: function() { this.callParent(); this.getStudent(); }, getStudent: function(){ console.log('get Student') } }); 

    Sencha Fiddle example: https://fiddle.sencha.com/#view/editor&fiddle/2m9i