1. #1
    Sencha User
    Join Date
    Oct 2011
    Posts
    61
    Answers
    3
    Vote Rating
    0
    azinyama is on a distinguished road

      0  

    Default Answered: Access Toolbar & StatusBar From Controller

    Answered: Access Toolbar & StatusBar From Controller


    Good day all!!!

    I have added to my Viewport a toolbar with menu items at the top and a status bar at the bottom. Code below:

    Code:
    initComponent: function()
        {                
            Ext.apply(this, 
            {
                id          : 'desktopWindow', 
                closable    : false,
                resizable   : false,            
                draggable   : false,
                border      : false,
                bodyBorder  : false, 
                frame       : false,
                region      : 'center',
                layout      : 'card',
                dockedItems : [{
                                xtype       : 'toolbar',
                                dock        : 'top',
                                id          : 'desktopToolBar', 
                                layout      : 'table',
                                border      : '0',
                                bodyBorder  : false
                            },
                            {
                                xtype       : 'statusbar',
                                dock        : 'bottom',
                                id          : 'desktopStatusBar',
                                autoClear   : 1000,
                                defaultText : 'Ready...',
                                iconCls     : 'x-status-valid',
                                width       : '100%',
                                items       : ['-',
                                            {
                                                xtype   : 'tbtext',
                                                id      : 'desktopUser',
                                                text    : this.Users_Name,
                                                flex    : 1
                                            },
                                            '-',
                                            {
                                                xtype   : 'tbtext',
                                                id      : 'desktopClock',
                                                text    : Ext.Date.format(new Date(), 'l, F d, H:i:s'),
                                                flex    : 1
                                            }]
                            }]
            });
                
            this.callParent(arguments);
            
            this.startClockTask();
            
            this.on('beforedestroy', this.stopClockTask, this);
        },
    Now I'm getting stuck at access the toolbar and status bar from the contoller. How would I go about doing this. I have tried this (below):

    Code:
        {
            ref     : 'desktopToolBar',
            selector: 'desktopWindow [dockedItems=desktopToolBar]'
        },
    But no luck there.

    Help is greatly appreciated.

  2. you can also try this code-

    Code:
    {
         ref : 'desktopToolBar'
        , selector: '#desktopWindow dockedItem[id=desktopToolBar]'
    }

  3. #2
    Sencha User
    Join Date
    May 2011
    Location
    Ukraine, Rivne
    Posts
    247
    Answers
    44
    Vote Rating
    42
    redraid has a spectacular aura about redraid has a spectacular aura about redraid has a spectacular aura about

      0  

    Default


    try:

    { ref : 'desktopToolBar', selector: 'desktopWindow desktopToolBar' },

  4. #3
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Answers
    124
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default


    you can also try this code-

    Code:
    {
         ref : 'desktopToolBar'
        , selector: '#desktopWindow dockedItem[id=desktopToolBar]'
    }
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 2

Tags for this Thread