Results 1 to 3 of 3

Thread: Toolbars of panels are inacessible

  1. #1

    Default Toolbars of panels are inacessible

    Fellow programmers,

    I have the following problem. I am adding tbars to panels in an application. Those tbars must contain datefields. If the 'genera' period selector is used, I must write the selected dates in those datefields. But it is impossible to access the tbars from outside. The method panel.getTbar() doesn't seem to exist and the tbars of panels are actually shown as null.

    For example:

    Code:
    new Ext.Panel({
    
                    width: '100%',
                    title: 'BOVEN',
                    layout: {
                        type: 'hbox',
                    },
                    defaults: {
                        flex: 1,
                        height: '100%'
                    },
                    items: [
                        {
                            xtype: 'kpi.scoresByMonth',
                            id: 'ccKpiScoresByMonth',
                            tbar: [
                                { text: 'BUTTON'}
                            ]
                        },
                        {
                            xtype: 'kpi.contractRevenuesByMonth',
                            id: 'ccKpiContractRevenuesByMonth'
                        }
                    ],
                    style: {
                        'border': '4px solid red'
                    }
                })
    I can look up the component - ccKpiScoresByMonth - by its id, and it is found. The debugger shows it with properties and the right id. But the tbar is null and getTbar() doesn't work at all. I have been stuck at this for hours! Does anybody have any clue where this can possible come from?

    Thanks in advance for any help!

  2. #2

    Default

    I have found the problem. I was using documentation of 'modern' but the app is in 'classic', so it doesn't support the getTbar method. Strangely enough the tbar may or not be accessible from the outside depending on how the object has been created. If I create it with only the xtype I can access the toolbar, but getComponent() doesn't work. If I create it with Ext.Create(...) it is the other way round: no tbar but getComponent works.

    I currently access the components in the toolbar using their reference and the lookup method. That works and seems to be the intended way of doing it.

  3. #3
    Sencha Premium User jvandemerwe's Avatar
    Join Date
    Apr 2009
    Location
    Raalte, Netherlands
    Posts
    252

    Default

    Why not using 'dockedItems'?

    Code:
    dockedItems: [{
        xtype: 'SomeToolbar',
        dock: 'top'
    },{
        xtype: 'SomeOtherToolbar',
        dock: 'top',
    }, {
        xtype: 'pagingtoolbar',
        store: store,
        dock: 'bottom'
    }],
    Quote Originally Posted by pvleeuwen View Post
    I have found the problem. I was using documentation of 'modern' but the app is in 'classic', so it doesn't support the getTbar method. Strangely enough the tbar may or not be accessible from the outside depending on how the object has been created. If I create it with only the xtype I can access the toolbar, but getComponent() doesn't work. If I create it with Ext.Create(...) it is the other way round: no tbar but getComponent works.

    I currently access the components in the toolbar using their reference and the lookup method. That works and seems to be the intended way of doing it.
    Professional Sencha ExtJS and PHP development since 2007

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •