@lukac-jozef
@lukac-jozef
Forum Replies Created
-
AuthorPosts
-
November 3, 2021 at 12:16 pm in reply to: How to get id’s of type LayoutPanelItem during closing event #102490
Lukac.Jozef
ParticipantHi Yavor,
your last snippet helps me to find solution for us.
We use i18n at labels therfore I should look for id only.
Our solution:onClosing($event: any) { const dock = $event.path[0]; const tabItems: any[] = dock.querySelectorAll('.smart-tab-item'); const tabIndex: number = $event.detail.index; tabItems.forEach(tab => { if (undefined === tabIndex || tab.index === tabIndex) { console.log("closing :", tab.id); } }); }Regards Jozef.
-
This reply was modified 3 years, 12 months ago by
Lukac.Jozef.
October 28, 2021 at 5:22 am in reply to: How to get id’s of type LayoutPanelItem during closing event #102472Lukac.Jozef
ParticipantHello Yavor,
Thank you,
this look on first attempt as resolution for our problem.
Yes it gets always id, for use case when I closing dock it return correct Id.
But not for closing over tab, it returns Id what is not at our layout.
Our sample of layout:
{
“type”: “LayoutGroup”,
“items”: [
{
“type”: “LayoutPanel”,
“id”: “tabsWindowea26“, //generated by docking layout
“draggable”: true,
“floatable”: true,
“items”: [
{
“type”: “LayoutPanelItem”,
“label”: “LabelOfOwnComponent”,
“selected”: true,
“draggable”: true,
“floatable”: true,
“id”: “IdOfOwnComponent” //inserted own item with own id by insertAfterItem()
}
],
“size”: 1534,
“min”: 30,
“tabCloseButtons”: true
}
],
“orientation”: “vertical”,
“tabCloseButtons”: true
}Closing by dock event.path[0].id return correctly dock id tabsWindowea26.
Closing by tab event.path[0].id return random id tabs6d77.
Best regards
Jozef.
-
This reply was modified 3 years, 12 months ago by
-
AuthorPosts