diff options
author | Jo-Philipp Wich <jo@mein.io> | 2019-07-07 21:26:24 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2019-07-07 21:27:00 +0200 |
commit | f4c87f4dc4d5c91ea7413e451949b7c6d44b66ca (patch) | |
tree | a41b3e2ea17d6c83ccfe3dbcec869497ac826567 /modules/luci-base | |
parent | 2a229e50cf4c36d4fae07bbc2438a99ef5ad1032 (diff) |
luci-base: mvalue.htm: fix reading back multi value options
Fixes: 2a229e50c ("luci-base: fix cbi mvalue templates")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base')
-rw-r--r-- | modules/luci-base/luasrc/view/cbi/mvalue.htm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/luci-base/luasrc/view/cbi/mvalue.htm b/modules/luci-base/luasrc/view/cbi/mvalue.htm index d1fb80367..97e40abfa 100644 --- a/modules/luci-base/luasrc/view/cbi/mvalue.htm +++ b/modules/luci-base/luasrc/view/cbi/mvalue.htm @@ -1,6 +1,14 @@ <%+cbi/valueheader%> +<% + local util = require "luci.util" + local values = {} + local value + for value in util.imatch(self:cfgvalue(section) or self.default) do + values[#values+1] = value + end +%> <div<%=attr("data-ui-widget", luci.util.serialize_json({ - "Select", self:cfgvalue(section) or self.default, self:choices(), { + "Select", values, self:choices(), { id = cbid, name = cbid, size = self.size, |