@david
@david
Forum Replies Created
-
AuthorPosts
-
March 16, 2021 at 9:37 am in reply to: How to get LayoutPanelItem object from closing event parameter #101626
david
MemberI found a possible solution but it is a bit convoluted:
event.path[4].items[event.detail.index].id
The path[4] is the LayoutPanel which contains the closing tab.March 16, 2021 at 8:49 am in reply to: Programmatically inserted LayoutPanelItems are not draggable #101624david
MemberHi Yavor
I tried your solution and strangely it only works partially.
ngAfterViewInit(): void {
//A
const smartDockingLayout: DockingLayoutComponent = this.docking as DockingLayoutComponent; smartDockingLayout.layout[0].items[0].items.push(this.tabsWindowObject)
this.tabService.tabsChanged$.subscribe((t) => {
//B
const smartDockingLayout: DockingLayoutComponent = this.docking as DockingLayoutComponent; smartDockingLayout.layout[0].items[0].items.push(this.tabsWindowObject)
})
}
I have an obserable, and if it changes I add a new tab based on the changes.
I marked the two cases, ‘A’ works properly. ‘B’ works if it triggers immediately when I subscribe to the observable. But when I trigget the observable later, the layout changes and the tab is in there (console.log verifies this) but the docking layout UI won’t update with the new tab.
I also tried:
ngAfterViewInit(): void {
setInterval(()=>{
const smartDockingLayout: DockingLayoutComponent = this.docking as DockingLayoutComponent; smartDockingLayout.layout[0].items[0].items.push(this.tabsWindowObject)
})
}
And this won’t work either, the new tab is not visible on the ui, but it is in the ‘smartDockingLayout.layout’ if I log it.
-
AuthorPosts