forked from angular-ui/ui-select
-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo-selectize-with-bootstrap.html
111 lines (90 loc) · 4.32 KB
/
demo-selectize-with-bootstrap.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
109
110
111
<style>
body {
padding: 15px;
}
.selectize-control {
/* Align Selectize with input-group-btn */
top: 2px;
}
.selectize-control > .selectize-dropdown {
top: 34px;
}
/* Reset right rounded corners, see Bootstrap input-groups.less */
.input-group > .selectize-control > .selectize-input {
border-bottom-right-radius: 0;
border-top-right-radius: 0;
}
</style>
<p>Selected: {{ctrl.person.selected.name}}</p>
<form class="form-horizontal">
<fieldset>
<legend>ui-select inside a Bootstrap form</legend>
<div class="form-group">
<label class="col-sm-3 control-label">Default</label>
<div class="col-sm-6">
<ui-select ng-model="ctrl.person.selected" theme="selectize" title="Choose a person">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="item in ctrl.people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Grouped</label>
<div class="col-sm-6">
<ui-select ng-model="ctrl.person.selected" theme="selectize" title="Choose a person">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices group-by="'country'" repeat="item in ctrl.people | filter: $select.search">
<span ng-bind-html="item.name | highlight: $select.search"></span>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">With a clear button</label>
<div class="col-sm-6">
<div class="input-group">
<ui-select ng-model="ctrl.person.selected" theme="selectize">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="item in ctrl.people | filter: $select.search">
<span ng-bind-html="item.name | highlight: $select.search"></span>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
<span class="input-group-btn">
<button type="button" ng-click="ctrl.person.selected = undefined" class="btn btn-default">
<span class="glyphicon glyphicon-trash"></span>
</button>
</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Multiple</label>
<div class="col-sm-6">
<ui-select ng-model="ctrl.person.selected" multiple theme="selectize" title="Choose a person">
<ui-select-match placeholder="Select or search a person in the list...">{{$item.name}}</ui-select-match>
<ui-select-choices repeat="item in ctrl.people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">Disabled</label>
<div class="col-sm-6">
<ui-select ng-model="ctrl.person.selected" theme="selectize" class="form-control" ng-disabled="true" title="Choose a person">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="item in ctrl.people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
</div>
</div>
</fieldset>
</form>