This fiddle shows the issue.
The tab panel is not showing a tab's body correctly when the following steps occur:
When 6 occurs, the tab strip shows the first tab as active but its body is not shown.
This is happening because of two pieces:
I've tried setting tabPanel.layout.activeItem = null after step 4, but that didn't work.
The only way I've gotten around this is by activating the second tab before the first.
Uncomment the section at the bottom of the fiddle to show the work around.
The tab panel is not showing a tab's body correctly when the following steps occur:
- Three tab are in the tab panel.
- Switch to the third tab.
- Disable the first and second tabs.
- Remove the third tab.
- Enable the first and second tabs.
- Set the first tab as the active tab.
When 6 occurs, the tab strip shows the first tab as active but its body is not shown.
This is happening because of two pieces:
- Ext.tab.Panel.setActiveTab calls Ext.layout.container.Card.setActiveItem, which checks this.activeItem. (this is the tab panel's layout)
It points to the first tab (see bullet below), so it ignores the call because it thinks it is already active.
This is inconsistent with the tab panel which had this.activeTab as null. - When step 4 occurs, it tries to switch to the first enabled tab. (Ext.tab.Panel.doRemove calls Ext.tab.Bar.findNextActivatable)
Because no tab is enabled, the me.setActiveTab is skipped.
this.callParent does me.onRemove, which does me.tabBar.remove, which does me.updateLayout.
This eventually calls Ext.layout.container.Card.getActiveItem.
This calls Ext.layout.container.Card.parseActiveItem, and it falls into the second conditional and returns the item at [0].
I've tried setting tabPanel.layout.activeItem = null after step 4, but that didn't work.
The only way I've gotten around this is by activating the second tab before the first.
Uncomment the section at the bottom of the fiddle to show the work around.
Aucun commentaire:
Enregistrer un commentaire