mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 17:22:45 -05:00
add ability to dynamically update tabs (#9911)
* add dashboard and tabbedPanel samples * add updateTabs to tabbedPanel component * add updateTabs to tabbedPanel component
This commit is contained in:
@@ -352,6 +352,7 @@ export abstract class ContainerBase<T> extends ComponentBase {
|
||||
|
||||
public clearContainer(): void {
|
||||
this.items = [];
|
||||
this.onItemsUpdated();
|
||||
this._changeRef.detectChanges();
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,12 @@ export default class TabbedPanelComponent extends ContainerBase<TabConfig> imple
|
||||
}
|
||||
|
||||
onItemsUpdated(): void {
|
||||
const firstTabIndex = this.tabs.findIndex(tab => tab.type === 'tab');
|
||||
if (this.items.length === 0) {
|
||||
this._itemIndexToProcess = 0;
|
||||
this._tabs = [];
|
||||
}
|
||||
|
||||
const firstTabIndex = this._tabs.findIndex(tab => tab.type === 'tab');
|
||||
if (firstTabIndex >= 0) {
|
||||
this._panel.selectTab(firstTabIndex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user