When i remove a tab with the method “removeTab(tab,mode)”, the id of tab removed is not deleted in the collection “tabbar.tabsId”
How i can resolve this bug?
Problem confirmed and fixed, please use attached js file instead of original one ( if you are using pro version - please contact us directly at support@dhtmlx.com )
dhtmlxtabbar.zip (10.7 KB)
The problem persist… i set content to my tab (a div), create 2 or more tabs, and, when close one, my content (div) disappear and cause this error:
The issue can’t be reconstructed.
Original fix , resolved situation with not removed ID from inner collections ( which has not any visible effects )
According to stack trace, while removing tab in your case, tabbar tries to select some sibling tab - but can’t locate it correctly.
Please check that each tab has unique ID.
If issue still occurs - please provide any kind of sample where issue can be reconstructed ( you can send it directly to support@dhtmlx.com )
The solution is create a div in runtime? How to i do it?
Instead of
Here is some content
a_tabbar.setContent(dt,content);
You can use
a_tabbar.setContentHTML(dt,“Here is some content”);
Thanks. My solution (works):
function newTab() {
var dt = new Date( ).valueOf();
a_tabbar.enableTabCloseButton(true);
a_tabbar.addTab(dt,‘Newtab’,‘200px’,0,0);
a_tabbar.setTabActive(dt, true);
newDiv(‘obj’+dt);
a_tabbar.setContent(dt,‘obj’+dt);
}
function newDiv(id){
if (document.createElement){
var content = document.getElementById(‘alldivs’);
var divn = document.createElement(‘div’);
divn.setAttribute(‘type’, ‘div’);
divn.setAttribute(‘id’, id);
var divntext = document.createTextNode(‘Text here’);
divn.appendChild(divntext);
content.appendChild(divn);
}
}
Tks for all!