luci-base: ui.js: support clearChoices()/addChoices() for DynLists
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
(cherry picked from commit cc123a03ce
)
This commit is contained in:
parent
f1d10ca9ab
commit
ae2243cb60
1 changed files with 10 additions and 0 deletions
|
@ -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');
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue