• 树状结构


    <!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>

  • 相关阅读:
    CF869E The Untended Antiquity 解题报告
    Walk 解题报告
    CF911F Tree Destruction 解题报告
    P4397 [JLOI2014]聪明的燕姿
    洛谷 P2329 [SCOI2005]栅栏 解题报告
    洛谷 P3747 [六省联考2017]相逢是问候 解题报告
    set-erase
    set-empty
    set-empty
    set-end
  • 原文地址:https://www.cnblogs.com/StinkyKids/p/6208874.html
Copyright © 2020-2023  润新知