aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/widget/tests/test_MultiComboBox.html
blob: 86f6c5479edf9e72893d36b44e7987cb1d2762ee (plain)
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
	"http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
	<title>Multi-input ComboBox widget</title>
		<style type="text/css">
			@import "../../../dijit/themes/tundra/tundra.css";
			@import "../../../dijit/tests/css/dijitTests.css";
			@import "../../../dojo/resources/dojo.css";

			body { margin:20px; } 
			#widget_frogin,
			#widget_frogin2 
			{ width: 30em; height:1.2em; }

		</style>
		<script type="text/javascript" src="../../../dojo/dojo.js"
			djConfig="isDebug: true, parseOnLoad: true"></script>
		<script type="text/javascript">
			dojo.require("dojox.widget.MultiComboBox"); 
			dojo.require("dojo.data.ItemFileReadStore"); 
			dojo.require("dijit.form.Button"); 
		</script>
	</head>
	<body class="tundra">
		
		<h1 class="testTitle">dojox.widget.MultiComboBox</h1>
		<p>
		This widget is an extension to ComboBox to allow "tag" style input using a datastore. Start typing
		into the box, and your options will be presented. The default delimiter is a comma, which can be over-ridden
		by the delimiter="" attrbute.
		</p>

		<div dojoType="dojo.data.ItemFileReadStore" jsId="memberTagStore"
			url="_tags.json"></div>
		
		<h3>Default:</h3>		
		<input dojoType="dojox.widget.MultiComboBox" id="frogin"
			store="memberTagStore"
			value=""
			searchAttr="tag"
			name="tags" />

		<h3>Alternate delimiter (:)</h3>
		<input dojoType="dojox.widget.MultiComboBox" id="frogin2"
			store="memberTagStore"
			value=""
			delimiter=":"
			searchAttr="tag"
			name="tags2" />

		<h3>From code:</h3>
		<button dojoType="dijit.form.Button">
			Make it.
			<script type="dojo/method" event="onClick">
				var widget = new dojox.widget.MultiComboBox({
					store:memberTagStore,
					searchAttr:"tag"
				},"frogin3");
				widget.startup();
				// only make it once. 
				this.setDisabled(true); 
			</script>
		</button><br>

		<input id="frogin3" name="tags3" value="" />
		

	</body>
</html>