oneclick.html
3.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE> ZTREE DEMO - one click</TITLE>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/demo.css" type="text/css">
<link rel="stylesheet" href="../../css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="../../js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="../../js/jquery.ztree.core-3.0.js"></script>
<!-- <script type="text/javascript" src="../../js/jquery.ztree.excheck-3.0.js"></script>
<script type="text/javascript" src="../../js/jquery.ztree.exedit-3.0.js"></script>-->
<SCRIPT LANGUAGE="JavaScript">
<!--
var setting = {
view: {
dblClickExpand: false,
showLine: false
},
data: {
simpleData: {
enable: true
}
},
callback: {
onClick: onClick
}
};
var zNodes =[
{ id:1, pId:0, name:"鏍?Root"},
{ id:11, pId:1, name:"鐖惰妭鐐?1"},
{ id:111, pId:11, name:"鍙跺瓙鑺傜偣111"},
{ id:112, pId:11, name:"鍙跺瓙鑺傜偣112"},
{ id:113, pId:11, name:"鍙跺瓙鑺傜偣113"},
{ id:114, pId:11, name:"鍙跺瓙鑺傜偣114"},
{ id:12, pId:1, name:"鐖惰妭鐐?2"},
{ id:121, pId:12, name:"鍙跺瓙鑺傜偣121"},
{ id:122, pId:12, name:"鍙跺瓙鑺傜偣122"},
{ id:123, pId:12, name:"鍙跺瓙鑺傜偣123"},
{ id:124, pId:12, name:"鍙跺瓙鑺傜偣124"},
{ id:13, pId:1, name:"鐖惰妭鐐?3"},
{ id:131, pId:13, name:"鍙跺瓙鑺傜偣131"},
{ id:132, pId:13, name:"鍙跺瓙鑺傜偣132"},
{ id:133, pId:13, name:"鍙跺瓙鑺傜偣133"},
{ id:134, pId:13, name:"鍙跺瓙鑺傜偣134"}
];
function onClick(e,treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
zTree.expandNode(treeNode);
}
$(document).ready(function(){
$.fn.zTree.init($("#treeDemo"), setting, zNodes);
});
//-->
</SCRIPT>
<style type="text/css">
.ztree li button.switch {visibility:hidden; width:1px;}
.ztree li button.switch.roots_docu {visibility:visible; width:16px;}
.ztree li button.switch.center_docu {visibility:visible; width:16px;}
.ztree li button.switch.bottom_docu {visibility:visible; width:16px;}
</style>
</HEAD>
<BODY>
<h1>鍗曞嚮灞曞紑/鎶樺彔鑺傜偣</h1>
<h6>[ 鏂囦欢璺緞锛歞emo/super/oneclick.html ]</h6>
<div class="content_wrap">
<div class="zTreeDemoBackground left">
<ul id="treeDemo" class="ztree"></ul>
</div>
<div class="right">
<ul class="info">
<li class="title"><h2>瀹炵幇鏂规硶璇存槑</h2>
<ul class="list">
<li>zTree 榛樿涓嶆彁渚涘崟鍑诲睍寮€鑺傜偣鐨勫姛鑳斤紝浣嗗彲浠ュ埄鐢?onClick 浜嬩欢鍥炶皟鍑芥暟杞绘澗瀹炵幇姝ゅ姛鑳?/li>
<li class="highlight_red">涓轰簡閬垮厤涓庡弻鍑诲姛鑳藉啿绐侊紝寤鸿鍏抽棴鍙屽嚮灞曞紑鑺傜偣鐨勫姛鑳斤紝璇疯缃?setting.view.dblClickExpand = false </li>
<li class="highlight_red">鍙互灏嗘墍鏈夌殑 +/- 寮€鍏抽殣钘忥紝璇锋煡鐪嬫湰椤甸潰婧愮爜锛屾煡鐪?css 璁剧疆 </li>
<li class="highlight_red">鐢变簬 +/- 寮€鍏充笌 鑺傜偣杩炴帴绾挎槸閰嶅鐨勶紝鎵€浠ュ鏋滀笉鏄剧ず +/- 寮€鍏崇殑璇濓紝閭d箞璇疯缃?setting.view.showLine = false 闅愯棌杩炴帴绾?</li>
</ul>
</li>
</ul>
</div>
</div>
</BODY>
</HTML>