1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    11
    Vote Rating
    0
    Answers
    1
    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
    St. Louis, MO
    Posts
    33,656
    Vote Rating
    435
    Answers
    3108
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    In your tabBar config Object, have you tried setting hidden : true?
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    http://www.JSONPLint.com - Source to lint your JSONP!

    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 almost in print!

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

  4. #3
    Sencha User
    Join Date
    Oct 2010
    Posts
    11
    Vote Rating
    0
    Answers
    1
    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
    Vote Rating
    0
    Answers
    1
    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
    Vote Rating
    0
    Answers
    1
    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);