@lukac-jozef

@lukac-jozef

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Lukac.Jozef
    Participant
    Up
    1
    Down

    Hi 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 9 months, 2 weeks ago by Lukac.Jozef.
    Lukac.Jozef
    Participant
    Up
    0
    Down

    Hello 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.

     

     

Viewing 2 posts - 1 through 2 (of 2 total)