<div dojoType="dijit.layout.AccordionContainer" style="height: 500px;">
<div dojoType="dijit.layout.ContentPane" title="Total Enrollment" id="TotalEnrollDiv" selected="false" name="abc" dojoAttachEvent="ondijitclick:_onButtonClick">
<ul>
<li><a href="#" id="TEState" onclick="attention(id);"> Michigan </a> </li>
<li><a href="#" id="TESE" onclick="attention(id);"> SouthEast MI </a> </li>
<li><a href="#" id="TEStateChange" onclick="attention(id);"> MI Change</a></li>
<li><a href="#" id="TESEChange" onclick="attention(id);">SE MI Change</a></li>
</ul>
<script type="dojo/connect">
var myDiv= dijit.byId("TotalEnrollDiv");
this.connect(this,"onclick",function(evt){
alert("myDivVal");
});
</script>
</div>
<div dojoType="dijit.layout.ContentPane" title="UnderGrad. Enrollment" selected="true" id="UGEnroll">
<ul>
<li><a href="#" id="UGState" onclick="attention(id);">Michigan </a> </li>
<li><a href="#" id="UGSE" onclick="attention(id);"> SouthEast MI </a> </li>
<li><a href="#" id="UGStateChange" onclick="attention(id);"> MI Change </a></li>
<li><a href="#" id="UGSEChange" onclick="attention(id);">SE MI Change </a></li>
</ul>
</div>
</div>
答案 0 :(得分:0)
尝试将dojo / connect元素放在ContentPane中,并添加一个事件属性。单击ContentPane时,将执行该脚本元素内的所有内容。
<div dojoType="dijit.layout.ContentPane" title="UnderGrad. Enrollment" selected="true" id="UGEnroll">
<script type="dojo/connect" event="onClick">
alert("abc");
</script>
<ul>
<li><a href="#" id="UGState" onclick="attention(id);">Michigan </a> </li>
<li><a href="#" id="UGSE" onclick="attention(id);"> SouthEast MI </a> </li>
<li><a href="#" id="UGStateChange" onclick="attention(id);"> MI Change </a></li>
<li><a href="#" id="UGSEChange" onclick="attention(id);">SE MI Change </a></li>
</ul>
</div>
答案 1 :(得分:0)
我不确定,但我想这可行:
<script type="text/javascript">
dojo.connect(dijit.byId('UGEnroll'), 'onClick', function(arg) {
alert("myDivVal");
});
</script>