-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkolada_select.js
More file actions
32 lines (28 loc) · 978 Bytes
/
Copy pathkolada_select.js
File metadata and controls
32 lines (28 loc) · 978 Bytes
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
$(document).ready(function () {
for (var i = 0, len = kpilist.length; i < len; i++) {
kpi = kpilist[i]
$('#my-select').multiSelect('addOption', { value: kpi.id, text: kpi.id + " " + kpi.title });
}
});
$('#my-select').multiSelect({
selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='Sök KPI'>",
selectionHeader: "<p>Valda KPI:er</p>",
afterInit: function(ms){
var that = this,
$selectableSearch = that.$selectableUl.prev(),
selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)';
that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
.on('keydown', function(e){
if (e.which === 40){
that.$selectableUl.focus();
return false;
}
});
},
afterSelect: function(){
this.qs1.cache();
},
afterDeselect: function(){
this.qs1.cache();
}
});