1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    11
    Answers
    1
    Vote Rating
    0
    freightgate is on a distinguished road

      0  

    Default Answered: How to set tabbar not visible

    Answered: How to set tabbar not visible


    Hi,

    I have a main Tabpanel with one homescreen (login screen).

    Code:
    Mobile.views.Viewport = Ext.extend(Ext.TabPanel, {   
    
        fullscreen: true,
        initComponent: function() {
            
            window.localStorage.clear(),
            
            
            Ext.apply(this, {
                tabBar: {
                        id: 'viewport_tabbar',
                        dock: 'bottom',
                        layout: {
                                pack: 'center'
                          }
            
                },
                items: [
                    { xtype: 'component_homecard', 
                            id: 'viewport_component_home'},
                    { xtype: 'component_searchcardcontrolle', 
                           id: 'viewport_component_searchcardmain' },
                    { xtype: 'component_morecard' , 
                           id: 'viewport_component_morecard' }
                ]
            });
            Mobile.views.Viewport.superclass.initComponent.apply(this, arguments);
        }
    });
    If an user is not logined I want to hide the tabbar. Problem is, if I set the taber visible with my login action the application will not re-render automaticlly. After a resize of the browser I can see the tabbar.

    Can some one support me ? Or show me the best way to do this ?

    Regards

  2. Ok I solved it.

    this is my solution. Not nice but it is working

    var windowsize = Mobile.views.viewport.getSize();

    Mobile.views.viewport.setSize(windowsize.width-1,windowsize.height-1);
    Mobile.views.viewport.setSize(windowsize.width,windowsize.height);

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,604
    Answers
    3448
    Vote Rating
    818
    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


    In your tabBar config Object, have you tried setting hidden : true?
    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
    Oct 2010
    Posts
    11
    Answers
    1
    Vote Rating
    0
    freightgate is on a distinguished road

      0  

    Default


    Hi,

    yes in my tabbar config I have set

    hidden: true

    (sorry not in my post above)

    and in the controller I do this

    Code:
    var bottombar = Mobile.views.viewport.getComponent('viewport_tabbar');
            bottombar.setVisible(true);
    If I resize the browser I can see the toolbar, but not directly after the klick.

    I tried something like

    listener:afterrendered
    setVisible(false)

    without the hidden propertie
    but I had no success

  5. #4
    Sencha User
    Join Date
    Oct 2010
    Posts
    11
    Answers
    1
    Vote Rating
    0
    freightgate is on a distinguished road

      0  

    Default


    Can I simulate the resize of the browser ? Maybe this is a work around ?

  6. #5
    Sencha User
    Join Date
    Oct 2010
    Posts
    11
    Answers
    1
    Vote Rating
    0
    freightgate is on a distinguished road

      0  

    Default


    Ok I solved it.

    this is my solution. Not nice but it is working

    var windowsize = Mobile.views.viewport.getSize();

    Mobile.views.viewport.setSize(windowsize.width-1,windowsize.height-1);
    Mobile.views.viewport.setSize(windowsize.width,windowsize.height);

Thread Participants: 1