I have a parent class and child class as mentioned below.
Ext.ns("MyUi");
MyUi.ParentPanel = Ext.extend(Ext.form.FormPanel, {
initComponent: function() {
MyUiPanel.superclass.initComponent.call(this);
},
id: 'card-id',
layout: 'card',
activeItem: 0,
buttonAlign: 'center',
buttons:[{
text: "Next",
id: "card-next",
handler: function(){
Ext.getCmp('card-id').navigationHandler(1);
}
},{
text: "Previous",
id: "card-prev",
handler: function(){
Ext.getCmp('card-id').navigationHandler(-1);
},
disabled: true
},{
text: "Finish",
id: "finishButton",
}],
navigationHandler: function(increment){
//code to switch cards/items
}});
var panel1 = ...
var panel2 = ...
childPanel = Ext.extend(MyUi.ParentPanel, {
initComponent: function() {
var items = [panel1, panel2];
Ext.apply( this, {
items: items
});
Cx.Ui.ProvisionRPoolWizardPanel.superclass.initComponent.apply(this);
}
});
I want my child panel to override to parent panel button names and handlers.
For example, instead of ‘Finish’ I want to have name called “Complete” in child panel and I want to have its own handler.
And child panel should be able override parent panel “Next” handler code. For example, when I am on panel1, if I click ‘Next’, I want to do some
validations, and then I want to call parent panel’s “Next” handler function.
Why simply not create your child-specific buttons in
initComponent, for example: