I’m seeing what seems to be the same issue, but when I try to put together a demo showing the problem, the problem doesn’t occur. Still trying to work out what’s different between our application and my demo.
Ok… hopefully you have more success with getting your demo to not work than I am.
I’ve debugged a bit into my application, and it looks like the tabs aren’t getting displayed because there’s a flag that’s gotten stuck on true - conf.transActv. From what I can tell, this is supposed to indicate if the tab is in the process of being hidden/shown, so that the component doesn’t trip over itself trying to do more than one thing to a tab at a time. Unfortunately at some point, this flag never gets set back to false, and so the tabbar component mistakenly thinks it needs to ignore the show() call because a hide() call is still in progress. I’m still not sure why this happens in my application but not in my demo, however.
Ok, I still don’t know what’s causing this, but I’ve found a solution nonetheless.
Running this snippet below after your dhtmlx.js import - but BEFORE you create any tabbar components - should disable the transitions that I believe are causing the problem. Your tabbar won’t look as swishy and cool as it’s supposed to, but at least it’ll work the way you expect it to.
your solution works very well; but maybe it’s time to solve it in a more generic way, correcting the js; knowing dhx-guys are reading these notes, I’ll try to explain the problem in a more detailed way; I just downloaded the actual version - 2/3 version after the problem was told - and the problem is still there;
here’s a brief explaination
*) function which hides all existing tabs, and then shows the ones to activate;
if a tab’s not present, it creates it the first time
function ShowButtons(goTabs)
{
actualTabs=objTabBar.getAllTabs();
for (i=0; i<actualTabs.length; i++)
{
objTabBar.tabs(actualTabs[i]).hide();
}
thisArray=goTabs.split(',')
for (i=0;i<thisArray.length;i++)
{
idx=actualTabs.indexOf(thisArray[i]);
if (idx<0)
{
objTabBar.addTab(thisArray[i],thisArray[i]);
}
objTabBar.tabs(thisArray[i]).show();
}
}
and now the problematic thing:
if I call this function the first time, it works well
if I call this function (with other parameters) a second time, it may work or it may not work
if I call this function a third time, I’m pretty sure it won’t work anymore
when I say “it doesn’t work” I don’t mean there’s a js-error or something special: it simply
doesn’t show each tab it should
so calling this function
ShowButtons(“prodotti”)
ShowButtons(“prodotti,emissioni,inserisci”)
ShowButtons(“prodotti,emissioni,dettaglio,professioni,assicurati,uscita,storico,pf,az”)
the tabbar should show only the tabs which are parameters of the last call of the function;
but it won’t! most of the time it doesn’t show the first or the first two tabs at all
(at this moment - the third call - both of them are already existing and should just be
shown)
is there a more elegant solution than the one stated?
thanks!!!
it works perfectly! I suppose this is not the last version of the js, as it seems a little smaller than the one we have; should we just wait the next official release in which this correction will be present? thank you very much in the meantime!