Results 1 to 7 of 7

Thread: tabpanel activeTab is not overridden by container defaults

Hybrid View

Previous Post Previous Post   Next Post Next Post
    Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    60
    Vote Rating
    3
      0  

    Default tabpanel activeTab is not overridden by container defaults

    U]REQUIRED INFORMATION[/U]


    Architect Build tested:
    • 2.1.0 Build: 678


    Project Type:
    • ExtJS 4.1.x


    Description:
    • Tabpanel missing activeTab automatically set to 0 after moving a child from tree.
    • Tabpanel activeTab is not overridden by container defaults.


    Steps to reproduce the problem:
    • remove property activeTab from a TabPanel (because it is set by container defaults property)
    • Move Up (or down) a tab within TabPanel


    The result that was expected:
    • activeTab stays removed
    • Or container defaults overrides TabPanel child activeTab property


    The result that occurs instead:
    • activeTab:0 gets back
    • container defaults is being overridden by TabPanel.activeTab


    HELPFUL INFORMATION

    Possible fix:
    • not provided


    Operating System:
    • Window 7 Pro 64bits

  2. #2
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    Could you provide an example that illustrates the problem?
    Aaron Conran
    @aconran

  3. #3
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    60
    Vote Rating
    3
      0  

    Default

    1) define a Window containing a TabPanel (with 2 panels) :

    Code:
    Ext.define('MyApp.view.MyWindow', {
        extend: 'Ext.window.Window',
        height: 250,
        width: 400,
        title: 'My Window',
        initComponent: function() {
            var me = this;
            Ext.applyIf(me, {
                items: [
                    {
                        xtype: 'tabpanel',
                        activeTab: 0,
                        items: [
                            {xtype: 'panel',title: 'Tab 1'},
                            {xtype: 'panel',title: 'Tab 2'}
                        ]
                    }
                ]
            });
            me.callParent(arguments);
        }
    });
    2) In Application.launch() :
    Code:
    Ext.create('MyApp.view.MyWindow',{
            defaults:{
                activeTab:1 // consider this should not be a constant
            }
        }).show();
    => Tab1 is active (Tab2 should be)

    3) Now remove property activeTab:0 from TabPanel
    4) Save, publish and test => Tab2 is active (expected result)
    5) Now add a new panel to TabPanel (or reorder existing)
    => activeTab:0 is automatically added to TabPanel config

    Hope this helps
    Thanks

  4. #4
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    Quote Originally Posted by art.dev.ext View Post
    => Tab1 is active (Tab2 should be)
    Why would Tab2 be active? You are overriding the default from 1 to 0 and therefore Tab1 would be active.

    re: 5) we are setting a default activeTab for you; there is no way for us to know that you are creating it somewhere else and setting the defaults. You'll have to clear it.
    Aaron Conran
    @aconran

  5. #5
    Sencha Premium Member
    Join Date
    Mar 2008
    Posts
    60
    Vote Rating
    3
      0  

    Default

    No, I'm not overriding from 1 to 0, it is the way to reproduce it (SA set 0 as default).
    If you read further, you should see that I removed activeTab property from TabPanel.

    Let's consider having a toolbar with 2 buttons that open a window containing this tabpanel.
    The first button opens window with tabpanel.activeItem = 0
    The second one opens window with tabpanel.activeItem = 1
    Since my window is not destroyed on close, I have no problem only after it has been showed once.

    Now if any dev-guy need to add a third panel (and so another button), he will get throw this annoyance.

    Any button that will be clicked will always open window with activeTab:0 since deleted activeTab property will 'magicallly' come back

    The fact is that it may be an ExtJs bug instead of an Architect one. activeTab property should be overridden by container defaults, that does not happen here.

  6. #6
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    Quote Originally Posted by art.dev.ext View Post
    Any button that will be clicked will always open window with activeTab:0 since deleted activeTab property will 'magicallly' come back
    I understand the annoyance, this is by design though that we are setting a default tab.

    Quote Originally Posted by art.dev.ext View Post
    The fact is that it may be an ExtJs bug instead of an Architect one. activeTab property should be overridden by container defaults, that does not happen here.
    I don't understand this one. If you've set defaults but then set an activeTab directly, the activeTab that you set directly overrides the defaults, not the other way around.
    Aaron Conran
    @aconran

Posting Permissions

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