This repository has been archived by the owner on Feb 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
91 lines (82 loc) · 1.94 KB
/
index.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
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
88
89
90
91
<!DOCTYPE html>
<html lang="en">
<head>
</head>
<body>
<h2>Demo 1 - Basic</h2>
<form name="demo1" onsubmit="return false;">
L1 <select id="s1"></select>
L2 <select id="s2"></select>
L3 <select id="s3"></select>
</form>
<h2>Demo 2 - Pre-selected</h2>
<form name="demo2" onsubmit="return false;">
L1
<select id="s4">
<option>3</option>
</select>
L2
<select id="s5">
<option>3.2</option>
</select>
L3
<select id="s6">
<option>3.2.2</option>
</select>
</form>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script src="index.js"></script>
<script>
(function() {
var data = [{
text: '1',
value: 'v1',
children: [{
text: '1.1',
children: [{
text: '1.1.1',
}, {
text: '1.1.2',
}, {
text: '1.1.3',
}]
}, {
text: '1.2',
children: ['1.2.1', '1.2.2', '1.2.3']
}, {
text: '1.3',
children: ['1.3.1', '1.3.2', '1.3.3']
}]
}, {
text: '2',
children: ['2.1', '2.2', '2.3']
}, {
text: '3',
children: [{
text: '3.1',
children: ['3.1.1']
}, {
text: '3.2',
children: ['3.2.1', '3.2.2']
}, {
text: '3.3',
children: ['3.3.1', '3.3.2', '3.3.3']
}]
}, '4'];
$('#s1').cascadingSelect({
subSelects: ['#s2', '#s3'],
data: data,
placeholder: '-- Choose --',
placeholderWhenEmpty: '-'
});
$('#s4').cascadingSelect({
subSelects: ['#s5', '#s6'],
data: data
});
})();
</script>
</body>
</html>