我有一个带有六个标签的Dojo标签容器,每个标签都有一个iframe。
<div style="width: 100%; height: 500px; " >
<div data-dojo-type="dijit/layout/TabContainer" style="width: 100%; height: 100%" id="tabContainer" >
<div data-dojo-type="dijit/layout/ContentPane" title="Action Items" data-dojo-props="selected:true" id="pane1">
<iframe id="frame1" src="source1.html"></iframe>
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="Action Items" data-dojo-props="selected:true" id="pane2">
<iframe id="frame2" src="source2.html"></iframe>
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="Action Items" data-dojo-props="selected:true" id="pane3">
<iframe id="frame3" src="source3.html"></iframe>
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="Action Items" data-dojo-props="selected:true" id="pane4">
<iframe id="frame4" src="source4.html"></iframe>
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="Action Items" data-dojo-props="selected:true" id="pane5">
<iframe id="frame5" src="source5.html"></iframe>
</div>
<div data-dojo-type="dijit/layout/ContentPane" title="Action Items" data-dojo-props="selected:true" id="pane6">
<iframe id="frame6" src="source6.html"></iframe>
</div>
</div>
</div>
每个窗格的标题都有一个与标题相邻的复选框,其中包含以下代码:
dojo.query("#tabContainer .dijitTabPane").forEach(function(n){
new dijit.form.CheckBox({
checked: true,
id: "check"+n.id,
//This event added as a result of issue 1
onChange: function(b) {
var container = dijit.byId("tabContainer");
var tab = dijit.byId("check"+n.id);
container.selectChild(tab);
}
}).placeAt("tabContainer_tablist_"+n.id, "first");
});
问题#1:当我单击与选项卡关联的复选框时,选项卡不会更改。
问题#2:当我单击与选项卡关联的复选框时,onChange事件将清除整个窗格。