JQuery-treeview 高手请进 刚学树形菜单显示 开头就看不懂了。。。往高手指教 以下的几行代码啥意思
$(function(){$("#tree").treeview({collapsed:true,animated:"medium",control:"#sidetree...
$(function() {
$("#tree").treeview( {
collapsed : true,
animated : "medium",
control : "#sidetreecontrol",
persist : "location"
});
}) 展开
$("#tree").treeview( {
collapsed : true,
animated : "medium",
control : "#sidetreecontrol",
persist : "location"
});
}) 展开
2个回答
展开全部
<script type="text/javascript">
function getChildren(){
var node = $('#tt1').tree('getSelected'); //tt1是你的树的id
if (node){
alert(“有子节点");
} else {
alert("无子节点");
}
}
</script>
<ul id="tt1" class="easyui-tree" animate="true" dnd="false">
<li>
<span>Folder</span>
<ul>
<li state="closed">
<span>Sub Folder 1</span>
<ul>
<li>
<span><a href="">File 11</a></span>
</li>
<li>
<span>File 12</span>
</li>
<li>
<span>File 13</span>
</li>
</ul>
</li>
<li>
<span>File 2</span>
</li>
<li>
<span>File 3</span>
</li>
<li>File 4</li>
<li>File 5</li>
</ul>
</li>
<li>
<span>File21</span>
</li>
</ul>
<a href="#" onclick="getChildren1()">getChildren1</a>
function getChildren(){
var node = $('#tt1').tree('getSelected'); //tt1是你的树的id
if (node){
alert(“有子节点");
} else {
alert("无子节点");
}
}
</script>
<ul id="tt1" class="easyui-tree" animate="true" dnd="false">
<li>
<span>Folder</span>
<ul>
<li state="closed">
<span>Sub Folder 1</span>
<ul>
<li>
<span><a href="">File 11</a></span>
</li>
<li>
<span>File 12</span>
</li>
<li>
<span>File 13</span>
</li>
</ul>
</li>
<li>
<span>File 2</span>
</li>
<li>
<span>File 3</span>
</li>
<li>File 4</li>
<li>File 5</li>
</ul>
</li>
<li>
<span>File21</span>
</li>
</ul>
<a href="#" onclick="getChildren1()">getChildren1</a>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询