Reputation: 1010
I am having a Webix application with tabview. It has four tabs and they can be deleted by the 'x' button on their tab header. To create a deleted tab one needs to click on the tab name list in the left panel.
Snippet : https://webix.com/snippet/d637a6af
My requirement goes as follows:
1. The initial tab order is A,B,C,D respectively. If I delete B-tab, I want it to be added at the same place i.e between A and C. Is there a way to achieve that ?
Thanks.
Upvotes: 0
Views: 148
Reputation: 5144
(1)
If you want to preserve order of existing tab, probably it will be better to hide|show tabs instead of fully removing them
function open_new_tab(id) {
$$("mytabview").getTabbar().showOption(id+"tpl");
}
and
tabbar:{
on: {
"onBeforeTabClose":function(id){
this.hideOption(id);
this.refresh();
return false;
}
}
},
https://webix.com/snippet/73210568 https://docs.webix.com/api__link__ui.tabbar_hideoption.html
(2)
You need to use the same id for tab and for tab content, so instead of tabbar.add("a", text) you need to use tabbar.add("atpl",
Upvotes: 1