#101274
kaltura47
Member

how can i add tabs in one tab panel dynamically using javaScript I already have a panel with a tab and I want to add a new tab in the same panel,I want to add tab label and content on table td click function, somebody know how to do this? below is my code
const dockinglayout = document.querySelector(‘smart-docking-layout’);
dockinglayout.layout = [
];
folderWindowObject =
{
type: ‘LayoutPanel’,
id: ‘Id’ + count1,
label: foldername,
items: [{
label: foldername,
content: ‘<div id=”cardOpenArea’ + count1 + ‘” ></div>’
}],
tabPosition: ‘hidden’
};
dockinglayout.insertLayoutLeft(folderWindowObject);
tabsWindowObject =
{
type: ‘LayoutPanel’,
id: ‘tabPanel’ + count1,
label: ‘Tab’ + count1,
items: [{
label: tabs,
selected: false,
content: ‘<div id=”tabdata’ + count1 + ‘” > </div>’,
}],
headerPosition: ‘none’,
tabCloseButtons: true,
panelContainerSettings: {
size: ‘50%’
}
}
dockinglayout.insertLayoutRight(tabsWindowObject);