最近一直在用dojo,做些总结。因为度娘能回答的太少了。 网上给的示例代码不太符合我的需求,创建好一个tab container后,需要嵌入到tree节点中,而不是在固定的位置展现。
一. 创建tab container,需要注意的是,在创建好tc后,不要startup,必须将其追加到树节点后再startup,否则会无法显示。
var tc = new dijit.layout.TabContainer({ style: "height: 100%; width: 100%;" }, document.createElement("div")/*"tc1-prog"*/); tc.domNode.id="new"; tc.domNode.style.width="1000px"; tc.domNode.style.height="300px";
二.将创建好的tab container嵌入到树节点中。nodeWidget是树节点的节点控件。
nodeWidget.domNode.firstChild.lastChild.appendChild(tc.domNode); tc.startup();