• 树状结构


    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title></title>
    		<link rel="stylesheet" href="../easy/themes/default/easyui.css" />
    		<link rel="stylesheet" href="easy/themes/icon.css" />
    		<script type="text/javascript" src="../easy/jquery.min.js" ></script>
    		<script type="text/javascript" src="../easy/jquery.easyui.min.js" ></script>
    	</head>
    	<body>
    		<a href="javascript:;" class="easyui-linkbutton" id="append">追加</a>
    		<ul id="ul" class="easyui-tree" url="tree.php" checkbox="true" onlyLeafCheck="true" lines="true" dnd="true">
    			<!--<li>
    				<span>子节点1</span>
    				<ul>
    					<li><span>子节点的子节点</span>
    						<ul>
    							<li>节点</li>
    							<li>节点</li>
    							<li>节点</li>
    							<li>节点</li>
    						</ul>
    						<ul>
    							<li>
                                                              <ul>
    							<li>节点</li>
    							<li>节点</li>
    							<li>节点</li>
    							<li>节点</li>
    						</ul>
                                            </li><span>子节点的子节点</span></li>
    					<li><span>子节点的子节点</span></li>
    				</ul>
    			</li>
    			<li>子节点2</li>
    			<li>子节点3</li>
    		</ul>-->
    		<script>
    			$(function(){
    				$("#append").click(function(){
    					var li = $("#ul").tree("getSelected");
    					if(li) {
    						//追加
    						$("#ul").tree("append",{
    							parent:li.target,
    							data:[
    								{
    									id:11,
    									text:"节点11",
    								},
    								{
    									id:12,
    									text:"节点12",
    								},
    							],
    						});
    					}
    				});
    			})
    		</script>
    	</body>
    </html>
    

      

    <!DOCTYPE html><html><head><meta charset="UTF-8"><title></title><link rel="stylesheet" href="../easy/themes/default/easyui.css" /><link rel="stylesheet" href="easy/themes/icon.css" /><script type="text/javascript" src="../easy/jquery.min.js" ></script><script type="text/javascript" src="../easy/jquery.easyui.min.js" ></script></head><body><a href="javascript:;" class="easyui-linkbutton" id="append">追加</a><ul id="ul" class="easyui-tree" url="tree.php" checkbox="true" onlyLeafCheck="true" lines="true" dnd="true"><!--<li><span>子节点1</span><ul><li><span>子节点的子节点</span><ul><li>节点</li><li>节点</li><li>节点</li><li>节点</li></ul></li><li><span>子节点的子节点</span></li><li><span>子节点的子节点</span></li></ul></li><li>子节点2</li><li>子节点3</li></ul>--><script>$(function(){$("#append").click(function(){var li = $("#ul").tree("getSelected");if(li) {//追加$("#ul").tree("append",{parent:li.target,data:[{id:11,text:"节点11",},{id:12,text:"节点12",},],});}});})</script></body></html>

  • 相关阅读:
    PHP 魔术函数
    创建静态链接库
    Linux C 子进程的调度
    Android开发(三) android布局
    谷歌(Google)算法面试题
    Android开发(二) 详细了解android开发
    制作makefile文件
    SHELL编程
    5 Rules For A Good Web Design
    非托管代码方法的命名约定
  • 原文地址:https://www.cnblogs.com/StinkyKids/p/6208874.html
Copyright © 2020-2023  润新知