summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner/clientscript.js
diff options
context:
space:
mode:
authorChristian Klinger2016-08-08 14:30:18 +0200
committerChristian Klinger2016-08-08 14:30:18 +0200
commit19eec4188d6d871d980deee2255507ac7d265b6c (patch)
tree0ed082703c39033eafbaa79861b53487fa857014 /modules-available/roomplanner/clientscript.js
parentfixed bug. (diff)
downloadslx-admin-19eec4188d6d871d980deee2255507ac7d265b6c.tar.gz
slx-admin-19eec4188d6d871d980deee2255507ac7d265b6c.tar.xz
slx-admin-19eec4188d6d871d980deee2255507ac7d265b6c.zip
subnet select.
Diffstat (limited to 'modules-available/roomplanner/clientscript.js')
-rw-r--r--modules-available/roomplanner/clientscript.js64
1 files changed, 31 insertions, 33 deletions
diff --git a/modules-available/roomplanner/clientscript.js b/modules-available/roomplanner/clientscript.js
index b7bd5d55..c19e63ec 100644
--- a/modules-available/roomplanner/clientscript.js
+++ b/modules-available/roomplanner/clientscript.js
@@ -48,37 +48,6 @@ function loadMachines(query, callback) {
}
-var searchSettings = {
- plugins : ["remove_button"],
- valueField: 'machineuuid',
- searchField: "combined",
- //labelField: "combined",
- openOnFocus: false,
- create: false,
- render : { option : renderMachineEntry, item: renderMachineEntry},
- load: loadMachines,
- maxItems: 1,
- sortField: 'clientip',
- sortDirection: 'asc',
- onChange: clearSubnetBox
-
-}
-
-var subnetSettings = {
- plugins : ["remove_button"],
- valueField: 'machineuuid',
- searchField: "combined",
- //labelField: "combined",
- openOnFocus: false,
- create: false,
- render : { option : renderMachineEntry, item: renderMachineEntry},
- load: loadMachines,
- maxItems: 1,
- sortField: 'clientip',
- sortDirection: 'asc',
- onChange: clearSearchBox
-
-}
function clearSearchBox() {
$selectizeSearch[0].selectize.setValue([], true);
@@ -92,8 +61,37 @@ function initSelectize() {
console.log("initializing selectize");
/* init modal */
$modal = $('#selectMachineModal');
- $selectizeSearch = $('#machineSearchBox').selectize(searchSettings);
- $selectizeSubnet = $('#subnetBox').selectize(subnetSettings);
+
+ /* for the search */
+ $selectizeSearch = $('#machineSearchBox').selectize({
+ plugins : ["remove_button"],
+ valueField: 'machineuuid',
+ searchField: "combined",
+ openOnFocus: false,
+ create: false,
+ render : { option : renderMachineEntry, item: renderMachineEntry},
+ load: loadMachines,
+ maxItems: 1,
+ sortField: 'clientip',
+ sortDirection: 'asc',
+ onChange: clearSubnetBox
+ });
+
+
+ /* for the subnet box */
+ $selectizeSubnet = $('#subnetBox').selectize({
+ options: subnetMachines,
+ plugins : ["remove_button"],
+ valueField: 'machineuuid',
+ searchField: "combined",
+ openOnFocus: true,
+ create: false,
+ render : { option : renderMachineEntry, item: renderMachineEntry},
+ maxItems: 1,
+ sortField: 'clientip',
+ sortDirection: 'asc',
+ onChange: clearSearchBox
+ });
$('#selectMachineButton').on('click', onBtnSelect);