I will build an Application with a Menu (Tree) leftside and on the rightside my content.
Both are inside a Layoutcontainer (cell a and b).
I added a Tabbar to my Content-Cell b.
Now I wan´t to load my Modules(HTML, Javascript-Code, … ??) after clicking in my Menu in seperate Tabs, but I do not know what is the best way to do this at all.
It would be best to load the code/content after clicking the menu item dynamicly, but I do not know how…
…or is there a better solution?
Use the attachEvent method your tree on the left. Point it to a function aka create_tab(id). Define an object that will hold the ids of your tabs (do this at the top of your script). In the create_tab function, use the addTab method to add a new tab. Your menu should have an id by default, use that id to create a tab and store that id in your object you created earlier. You can check if a tab is already created by using if(objectVar[id]) { your code here } else { setTabActive(id) }
My question is still, “as I have to write the code”.
Finally, I want the tab content is loaded only, when I call the addTab-method.
The
tabbar.setContentHref(“calendar”,“my-content.php”)
and load something it is not perfect, because I must include the dhtml.js & .css again in my my-content.php.
and the other ways I know, execute the code before I added into a Tab.