Cant set content for tab init'd with attach.tabbar()

dhxLayout = new dhtmlXLayoutObject(document.body,“3T”);
tabbar = dhxLayout.cells(“c”).attachTabbar();
tabbar.addTab(“d1”,“Dashboard”,“100px”);
tabbar.setImagePath("/js/dhtmlx/dhtmlxTabbar/codebase/imgs/");
tabbar.setSkinColors("#e5e5e5","#ffffff");
tabbar.setSkin(“winRound”);
tabbar.setContent(“d1”,“dash”);
tabbar.setTabActive(“d1”);

thats for the initial tab. which loads fine. But when I try to add a new tab via:
tabbar.addTab(“t2”,“New Tab”);
tabbar.setContentHref(“t2”, “file.html”);

I even tried with tabbar.forceLoad(“t2”, “file.html”); still nothing.

The new tab is created but no contents are attached. Please help.

Hello,

setContentHref can be apply if you have set href mode: “ajax-html”, “iframes” or other.
dhtmlxTabbar/samples/01_initialization/05_loading_by_ajax.html
dhtmlxTabbar/samples/01_initialization/06_loading_by_iframes.html

or you may use container (dhtmlxcontainer.js) methods to set tab content. These methods can be applied to layout and accordion cells, windows and tabs:

tabbar.cells(“t2”).attachURL(“file.html”);

This method loads page into an iframe. To load content by Ajax, you may call
tabbar.cells(“t2”).attachURL(“file.html”,true);

That worked perfectly

Thanks.