summaryrefslogtreecommitdiffhomepage
path: root/libs/cbi/luasrc/view
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2008-08-04 17:16:27 +0000
committerSteven Barth <steven@midlink.org>2008-08-04 17:16:27 +0000
commit084db952ce2aa302a42f35fa34866f34cb06ba99 (patch)
tree41bcdef71918816ff78de209455edf1162fc8a9f /libs/cbi/luasrc/view
parent513e1cbba9e8ba98cc0b4f667aa89233b72b4dd1 (diff)
libs/cbi: Added value function to luci.cbi.Value to create Comboboxes
Diffstat (limited to 'libs/cbi/luasrc/view')
-rw-r--r--libs/cbi/luasrc/view/cbi/value.htm13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/cbi/luasrc/view/cbi/value.htm b/libs/cbi/luasrc/view/cbi/value.htm
index 5a7339d835..4d473bf5e6 100644
--- a/libs/cbi/luasrc/view/cbi/value.htm
+++ b/libs/cbi/luasrc/view/cbi/value.htm
@@ -14,4 +14,17 @@ $Id$
-%>
<%+cbi/valueheader%>
<input type="text" onchange="cbi_d_update(this.id)"<%= attr("name", cbid) .. attr("id", cbid) .. attr("value", self:cfgvalue(section)) .. ifattr(self.size, "size") .. ifattr(self.maxlength, "maxlength") %> />
+ <% if #self.keylist > 0 then -%>
+ <script type="text/javascript">
+ cbi_combobox_init('<%=cbid%>', {
+ <%-
+ for i, k in ipairs(self.keylist) do
+ -%>
+ <%-=string.format("%q", k) .. ":" .. string.format("%q", self.vallist[i])-%>,
+ <%-
+ end
+ -%>
+ }, '<%:cbi_select%>', '<%:cbi_manual%>');
+ </script>
+ <% end -%>
<%+cbi/valuefooter%>