在做项目时遇到一个easyui需要根据combobox的选中的item决定div的隐藏及可见的问题
这个div是在easyui的tabs中的,代码如下
<div id="statisticTab" data-options="region:'center',split:true,title:'成本统计',collapsible:false" data-options="closable:true" style="overflow: auto; display: none;">
<div class="easyui-layout" data-options="region:'center',split:true" style="width: 78%; height: 100%; border: 0px;" fit="true" style="border: 0px;">
<div id="treediv" data-options="region:'west',split:true,hide:true" style="width: 20%; border: 0px;">
<table id="statistics" data-options="region:'west'"
style="width: 100%; height: 100%;">
<thead>
<tr>
<th field="ID" width="10" hidden="true">ID</th>
<th field="Name" width="98%" editor="text">名称</th>
<th field="ParentID" width="10" hidden="true"></th>
</tr>
</thead>
</table>
</div>
</div>
</div>
请问,你贴的代码谁能看懂
要用api来隐藏,layout设置dom的没用
$(function(){
var panel=$('#xxxLayout').layout('panel','center')//获取center panel
panel.hide()
})
display:none;是隐藏没错。
根据combobox的选中的item决定div的隐藏,可以写JS去控制DIV的隐藏
$("#statisticTab" ).css("display", "none");