1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    42
    Answers
    2
    Vote Rating
    1
    GFI_SI is on a distinguished road

      0  

    Default Answered: How to access tab in a tabpanel and disable / enable ?

    Answered: How to access tab in a tabpanel and disable / enable ?


    I'm creating a new Viewport which is essentially a tabpanel.

    Code:
    var oViewPort = Ext.create('MyApp.view.Viewport');
    My Viewport looks like this

    Code:
    Ext.define('MyApp.view.Viewport', {
           extend: 'Ext.tab.Panel',
           config: {
               fullscreen: true,
            tabBarPosition: 'bottom',
            layout:{
                type: 'card'
            },
               items: [
                   { xtype: 'login', title: 'Login', id: 'login', iconCls: 'login' },
                { xtype: 'profile', title: 'Profile', id: 'profile', iconCls: 'user', disabled: true },
                { xtype: 'settings', title: 'Settings', id: 'settings', iconCls: 'settings', disabled: true }
            ]
        }
    });
    and my Viewport controller looks like this

    Code:
    Ext.define('MyApp.controller.Viewport', {
        extend: 'Ext.app.Controller',
        views: ['Viewport'],
        config: { 
            refs: {
                loginTab : {
                    selector : 'tabpanel panel[id=login]'
                },
                profileTab : {
                    selector : 'tabpanel panel[id=profile]'
                },
                settingsTab : {
                    selector : 'tabpanel panel[id=settings]'
                }
            }
        },
        init: function() {
        var oLoginTab = this.getLoginTab();
        }
        
    });
    When I try var oLoginTab = this.getLoginTab(); oLoginTab comes back as undefined.

    Any help would be gratefully appreciated.

  2. If you are going to use id, which I would recommend not, then you don't have to use

    Code:
    tabpanel panel[id=login]
    as your selector, you can simple use

    Code:
    #login

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,754
    Answers
    3462
    Vote Rating
    827
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    If you are going to use id, which I would recommend not, then you don't have to use

    Code:
    tabpanel panel[id=login]
    as your selector, you can simple use

    Code:
    #login
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    42
    Answers
    2
    Vote Rating
    1
    GFI_SI is on a distinguished road

      0  

    Default


    Sounded promising, but still I get an undefined object back.

    Not having much luck with this at all.

  5. #4
    Sencha User
    Join Date
    Apr 2011
    Posts
    42
    Answers
    2
    Vote Rating
    1
    GFI_SI is on a distinguished road

      0  

  6. #5
    Sencha User
    Join Date
    Feb 2012
    Posts
    1
    Vote Rating
    0
    kuljit is on a distinguished road

      0  

    Default


    The following works

    Modify the viewport container and use the following syntax

    Code:
    config: {
    		refs : {
    			login : { selector : 'login' },
    			profile : { selector : 'profile' },
    			settings : { selector : 'settings' },
    		}
    	},
    this.getLogin() will then work.

  7. #6
    Sencha User
    Join Date
    Apr 2011
    Posts
    42
    Answers
    2
    Vote Rating
    1
    GFI_SI is on a distinguished road

      0  

    Default


    Quote Originally Posted by mitchellsimoens View Post
    If you are going to use id, which I would recommend not, then you don't have to use

    Code:
    tabpanel panel[id=login]
    as your selector, you can simple use

    Code:
    #login
    This doesn't work for me. Marking it as the best answer in this particular situation is misleading.

Thread Participants: 2

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..."