This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
forked from daniel-llach/dw-typeahead
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
108 lines (103 loc) · 2.58 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>dw-typeahead</title>
<!-- context style -->
<link rel="stylesheet" type="text/css" href="./css/style.css">
<!-- wd-select dependencies -->
<script src="./bower_components/jquery/dist/jquery.min.js" type="text/javascript"></script>
<script src="./bower_components/underscore/underscore-min.js" type="text/javascript"></script>
<script src="./component/dw-typeahead.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="./component/dw-typeahead.css">
</head>
<body>
<div id="contetendorSample" class="contenedorFiltros">
<div id="sample1" class="demoDiv" style="margin-top: 600px"></div>
</div>
<script type="text/javascript">
// checkbox
$('#sample1').dwTypeahead({
placeholder: 'Select your animal',
data: [
{
id: 1,
primary: 'Cat',
secundary: 'Gray',
selected: false,
group: ['feline']
},
{
id: 2,
primary: 'Dog',
secundary: 'White',
selected: false,
group: ['canine']
},
{
id: 3,
primary: 'Cheetah',
secundary: 'yellow',
selected: false,
group: ['canine']
},
{
id: 4,
primary: 'Fox',
secundary: 'Brown',
selected: false,
group: ['canine']
},
{
id: 5,
primary: 'Culpeo',
secundary: 'Light Brown',
selected: true,
group: ['canine']
},
{
id: 6,
primary: 'Jaguar',
secundary: 'Yellow',
selected: false,
group: ['feline']
},
{
id: 7,
primary: 'Lion',
secundary: 'orange',
selected: false,
group: ['feline']
},
{
id: 8,
primary: 'African Wild Dog',
secundary: 'marbled',
selected: false,
group: ['canine']
},
{
id: 9,
primary: 'Yacare Caiman',
secundary: 'green',
selected: false,
group: ['reptile']
},
{
id: 10,
primary: 'Leopard Gecko',
secundary: 'light brown',
selected: false,
group: ['reptile']
}
]
})
// listeners
var smpl1 = $('#sample1');
smpl1.on({
change: function(event){
var result = smpl1.data('result');
console.log("sample1 data: ", result);
}
});
</script>