I've got a simple panel in architect that has a normal function in it. I want to execute that function after the construction of the panel completes. I did it successfully with the "override" but that seems like overkill. Is there some way to do that directly in SA without creating an override.
this is what I did that works but hoping for a simpler solution.
Code:
Ext.define('RegistrationApp.view.override.TabWizardPanel', {
override: 'RegistrationApp.view.TabWizardPanel',
constructor: function () {
this.callParent(arguments);
this.hideTabTitles();
}
});
Though for my example the generated class is not really necessary to show, but here it is just to add some context to this question.
Code:
Ext.define('RegistrationApp.view.TabWizardPanel', {
extend: 'Ext.tab.Panel',
alias: 'widget.tabWizardPanelAlias',
requires: [
'RegistrationApp.view.AttendeeSpeakerOrSponsor',
'RegistrationApp.view.AttendeeOrSpeaker',
'RegistrationApp.view.ForgotUsernameOrPassword',
'RegistrationApp.view.sponsor',
'RegistrationApp.view.override.TabWizardPanel'
],
height: 450,
id: 'TabWizardId',
itemId: '',
activeTab: 0,
initComponent: function() {
var me = this;
Ext.applyIf(me, {
items: [
{
xtype: 'AttendeeSpeakerOrSponsorAlias',
id: 'AttendeeSpeakerSponsorId'
},
{
xtype: 'AttendeeOrSpeakerAlias'
},
{
xtype: 'ForgotUsernameAlias'
},
{
xtype: 'sponsorAlias'
}
]
});
me.callParent(arguments);
},
getTabIdByName: function(stepName) {
var tabId = -1;
if (stepName === 'AttendeeSpeakerSponsorId') {
tabId = 0;
} else if (stepName === 'attendeeorspeaker') {
tabId = 1;
} else if (stepName === 'forgotusernameorpassword') {
tabId = 2;
} else if (stepName === 'Sponsor') {
tabId = 3;
}
return tabId;
},
hideTabTitles: function() {
console.log('hideTabTitles');
this.getTabBar().hide();
this.componentLayout.childrenChanged = true;
this.doComponentLayout();
}
});