diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-01-19 15:52:58 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-01-19 16:15:22 +0100 |
commit | cc123a03ce738dffae9abf5aefad9b75020a0a04 (patch) | |
tree | e9e7159b82a34ddc232b18ff5bdd450d09a3d966 | |
parent | 9733a182e8dc1713e27e784fa7aded553caad695 (diff) |
luci-base: ui.js: support clearChoices()/addChoices() for DynLists
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | modules/luci-base/htdocs/luci-static/resources/ui.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/ui.js b/modules/luci-base/htdocs/luci-static/resources/ui.js index 08196117b..08edaa147 100644 --- a/modules/luci-base/htdocs/luci-static/resources/ui.js +++ b/modules/luci-base/htdocs/luci-static/resources/ui.js @@ -1555,6 +1555,16 @@ var UIDynamicList = UIElement.extend({ for (var i = 0; i < values.length; i++) this.addItem(this.node, values[i], this.choices ? this.choices[values[i]] : null); + }, + + addChoices: function(values, labels) { + var dl = this.node.lastElementChild.firstElementChild; + L.dom.callClassMethod(dl, 'addChoices', values, labels); + }, + + clearChoices: function() { + var dl = this.node.lastElementChild.firstElementChild; + L.dom.callClassMethod(dl, 'clearChoices'); } }); |