forked from baukh789/select3
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdemo.html
51 lines (50 loc) · 1.67 KB
/
demo.html
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>select3:带树级的搜索下拉框插件</title>
<link rel="stylesheet" type="text/css" href="http://www.lovejavascript.com/css/base.css">
<link rel="stylesheet" type="text/css" href="http://www.lovejavascript.com/css/module.css"/>
<link rel="stylesheet" type="text/css" href="css/select3.css"/>
</head>
<body>
<h2>select3:带树级的搜索下拉框插件</h2>
<p>存在.json文件,谷歌需要放到环境中效果才能展现</p>
<hr/>
<div>
<div>
<input type="text" id="test1" style="width:300px;height:32px;"/>
</div>
<hr/>
<div>
<input type="text" id="test2" style="width:300px;height:32px;"/>
</div>
<hr/>
<div>
<input type="text" id="test3" style="width:300px;height:32px;"/>
</div>
</div>
<script type="text/javascript" src="http://www.lovejavascript.com/js/jquery-2.1.4.min.js"></script>
<script type="text/javascript" src="js/select3.js"></script>
<script type="text/javascript" id="script-source">
$(function(){
//当前使用调试数据,获取支撑数据
$.getJSON('data/testData.json', function(json){
$('#test1').select3({
treeData:json,
data:[6017625561183],
isDevelopMode: true
});
$('#test2').select3({
treeData:json
});
$('#test2').select3("data", [{id:6019564383383, name:"节点31"}, {id:6017625561183, name:"节点12"}]);
$('#test3').select3({
treeData:json
});
$('#test3').select3("val", "6019164630583");
});
});
</script>
</body>
</html>