1. #1
    Touch Premium Member pkellner's Avatar
    Join Date
    Sep 2008
    Location
    San Jose, California
    Posts
    790
    Vote Rating
    24
    pkellner will become famous soon enough pkellner will become famous soon enough

      0  

    Default In a panel class, how to run a function after contructor creation

    In a panel class, how to run a function after contructor creation


    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();
        }
    
    
    });
    Last edited by pkellner; 9 Feb 2013 at 10:56 AM. Reason: added generated class for completeness

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi