-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_jquery_versatilecomboBox.html
More file actions
196 lines (173 loc) · 5.62 KB
/
test_jquery_versatilecomboBox.html
File metadata and controls
196 lines (173 loc) · 5.62 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Autocomplete - Combobox</title>
<link href="jquery-ui-1.11.4/jquery-ui.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/ise.treeintable.css">
<link rel="stylesheet" type="text/css" href="css/ise.treeintable.css">
<script src="jquery-ui-1.11.4/external/jquery/jquery.js"></script>
<script src="jquery-ui-1.11.4/jquery-ui.js"></script>
<!--
<script type="text/javascript" src="js/jquery.ise.datastore.js"></script>
<script type="text/javascript" src="js/jquery.ise.treeintable.js"></script>
<script type="text/javascript" src="js/jquery.ise.conditioneditor.js"></script>
<script type="text/javascript" src="js/esprima.js"></script>
-->
<script type="text/javascript" src="js/jquery.ise.versatilecombobox.js"></script>
<style>
</style>
<script>
$(function() {
$( "#combobox" ).versatilecombobox();
$( "#toggle" ).click(function() {
$( "#combobox" ).toggle();
});
$( "#getValue2" ).click(function() {
var node = $( "#testDiv0" )[0];
var vcombox =$(node).data("iseVersatilecombobox")
alert(JSON.stringify(vcombox.selectedValue));
});
$( "#getValue3" ).click(function() {
var node = $( "#testDiv1" )[0];
var vcombox =$(node).data("iseVersatilecombobox")
alert(JSON.stringify(vcombox.selectedValue));
});
$( "#getValue3a" ).click(function() {
var node = $( "#testDiv1" )[0];
var vcombox =$(node).data("iseVersatilecombobox")
vcombox.setValue("BackboneJS");
});
$( "#getValue4" ).click(function() {
var node = $( "#testDiv2" )[0];
var vcombox =$(node).data("iseVersatilecombobox");
alert(JSON.stringify(vcombox.selectedValue));
});
$( "#getValue5" ).click(function() {
var node = $( "#testDiv2" )[0];
var vcombox =$(node).data("iseVersatilecombobox");
var newSelectOptions=[
{
"label": "ReactJS",
"value": "React JS"
},
{
"label": "AngularJS",
"value": "Angular JS"
},
{
"label": "KnockoutJS",
"value": "KNockoud JS"
}
];
vcombox.selectOptions= newSelectOptions;
vcombox.reset();
});
//-----------------
$( "#testDiv0" ).versatilecombobox({
"url":"data/test_progamming_language.json"
});
$( "#testDiv1" ).versatilecombobox({
"boolMustSelect":false,
"defaultValue":"React JS",
"selectOptions": [
{
"label": "ReactJS",
"value": "React JS"
},
{
"label": "AngularJS",
"value": "Angular JS"
},
{
"label": "KnockoutJS",
"value": "KNockoud JS"
}
]
});
$( "#testDiv2" ).versatilecombobox({
"boolMustSelect":false,
"boolInputReadOnly":true,
"defaultValue":">=",
createComplete : function(){
console.log("hook in createComplete()");
},
"selectOptions": [
{
"label": "=",
"value": "="
},
{
"label": ">=",
"value": ">="
},
{
"label": "<=",
"value": "<="
},
{
"label": "<",
"value": "<"
},
{
"label": ">",
"value": ">"
}
]
});
});
</script>
</head>
<body>
<hr><b>This demonstrates VersatileComboBox Widget. <br/> <br/>This widget provides auto-suggestions when user types. If user clicks the right arrow, it will list all options. <br/> In application, you can control what options to provide for user</b> </hr>
<br/>
<br/>
<div class="ui-widget">
<label>Your preferred programming language: </label>
<select id="combobox">
<option value="">Select one...</option>
<option value="ActionScript">ActionScript</option>
<option value="AppleScript">AppleScript</option>
<option value="Asp">Asp</option>
<option value="BASIC">BASIC</option>
<option value="C">C</option>
<option value="C++">C++</option>
<option value="Clojure">Clojure</option>
<option value="COBOL">COBOL</option>
<option value="ColdFusion">ColdFusion</option>
<option value="Erlang">Erlang</option>
<option value="Fortran">Fortran</option>
<option value="Groovy">Groovy</option>
<option value="Haskell">Haskell</option>
<option value="Java">Java</option>
<option value="JavaScript">JavaScript</option>
<option value="Lisp">Lisp</option>
<option value="Perl">Perl</option>
<option value="PHP">PHP</option>
<option value="Python">Python</option>
<option value="Ruby">Ruby</option>
<option value="Scala">Scala</option>
<option value="Scheme">Scheme</option>
</select>
</div>
<button id="toggle">Show underlying select</button>
<br/>
<label>Test2 use AJAX to fetch options: </label>
<div id="testDiv0"></div>
<br/>
<button id="getValue2">Get Value from 2nd Combo</button>
<br/>
<br/>
<label>Test3 use provided options, it accepts any type-in text: </label>
<div id="testDiv1"></div>
<br/>
<button id="getValue3">Get Value from 3nd Combo</button>
<button id="getValue3a">Set Value from 3nd Combo</button>
<br/>
<label>Test4 input part is read-only, user must pick from dropdown: </label>
<div id="testDiv2"></div>
<br/>
<button id="getValue4">Get Value from 4nd Combo</button>
<button style="margin:5px" id="getValue5">Change combo-4 options</button>
</body>
</html>