100% found this document useful (1 vote)
52 views1 page

DOJO NESTED DynamicTabs Createjs

This document creates and manages tab interfaces in a tab container widget. It first checks if a tab exists by its ID, and if not, it creates the tab and adds it to the container. It then checks if a child tab container exists under the tab, creating it if not. Finally, it either adds new tabs to this child container or directly adds content to the tab depending on a subtype attribute.

Uploaded by

api-3769899
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
52 views1 page

DOJO NESTED DynamicTabs Createjs

This document creates and manages tab interfaces in a tab container widget. It first checks if a tab exists by its ID, and if not, it creates the tab and adds it to the container. It then checks if a child tab container exists under the tab, creating it if not. Finally, it either adds new tabs to this child container or directly adds content to the tab depending on a subtype attribute.

Uploaded by

api-3769899
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

//create a corresponding ID

var tabId = "tab" + tabName;

//check whether the tab is already created


var tabElement = dojo.widget.byId(tabId);
if(!tabElement)
{
//If it is not there create it
tabParams = {id: tabId, label: tabName};
tab = dojo.widget.createWidget("ContentPane",
tabParams);

innerTabParams = {id: "inner_" + tabId,


style:"background:#FFFFFF;width:100%;height:100%;"};
innerContentPane =
dojo.widget.createWidget("ContentPane", innerTabParams);
tab.addChild(innerContentPane);

tabContainer = dojo.widget.byId("ribbonContainer");
tabContainer.addChild(tab);
}

innerContentPane = dojo.widget.byId("inner_" + tabId);

var subType =
oAllExternalTests[i].getAttribute("testtype").split('/')[1];
if(subType)
{
var newTabContainerElement = dojo.widget.byId("itc_"
+ tabId);
if(!newTabContainerElement)
{
newTabContainerParams = {id: "itc_" + tabId,
style:"background:#000000;width:100%;height:100%;"};
newTabContainer =
dojo.widget.createWidget("TabContainer", newTabContainerParams);
innerContentPane.addChild(newTabContainer);
}

newTabContainer = dojo.widget.byId("itc_" + tabId);

newTabParams = {id: "ntab" + subType, label: subType};


newTab = dojo.widget.createWidget("ContentPane",
newTabParams);

//Add some content to the new tab. We add a div

newTabContainer.addChild(newTab);
}else{

//Add some content directly to the content pane


innerContentPane.domNode.appendChild(viewer)
}

You might also like