-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.js
31 lines (30 loc) · 1.04 KB
/
page.js
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
(function($) {
function attachBehaviors (behaviors) {
for (var selector in behaviors)
$(selector).each(behaviors[selector]);
};
const datalist = $('input.my-flexdatalist')
results = $('div#imx-results')[0];
$(function() {
attachBehaviors({
'input.my-flexdatalist': function (inst, elm) {
datalist.flexdatalist({
"multiple": true,
"url": "dataService.mjs",
"searchIn": "name",
"searchContain": true,
"visibleProperties": ["name", "desc"],
"focusFirstResult": true,
"valuesSeparator": " "
});
},
'button': function (inst, elm) {
$(elm).click(function(evt) {
evt.preventDefault();
results.innerHTML = datalist.val();
return false;
});
}
});
});
})(jQuery);