Hybrid View
-
13 Feb 2013 5:49 AM #1
tabpanel activeTab is not overridden by container defaults
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
-
13 Feb 2013 10:01 AM #2
Could you provide an example that illustrates the problem?
Aaron Conran
@aconran
Sencha Architect Development Team
-
14 Feb 2013 1:03 AM #3
1) define a Window containing a TabPanel (with 2 panels) :
2) In Application.launch() :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); } });
=> Tab1 is active (Tab2 should be)Code:Ext.create('MyApp.view.MyWindow',{ defaults:{ activeTab:1 // consider this should not be a constant } }).show();
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
-
14 Feb 2013 1:16 PM #4
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
Sencha Architect Development Team
-
15 Feb 2013 12:24 AM #5
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.
-
15 Feb 2013 9:30 AM #6
I understand the annoyance, this is by design though that we are setting a default tab.
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
Sencha Architect Development Team
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote