Commit 53da1cd7 authored by Ayush Tiwari's avatar Ayush Tiwari

[erp5_web_renderjs_ui]: Separate function for listbox content load

parent fb7d1cee
......@@ -23,6 +23,20 @@
}
}
function loadListboxContent(gadget, result) {
var key;
if (gadget.state.options.form_content) {
for (key in result) {
if (result.hasOwnProperty(key)) {
if (typeof result[key].field_gadget_param === "object" &&
result[key].field_gadget_param.hasOwnProperty("key") &&
gadget.state.options.form_content[result[key].field_gadget_param.key]) {
result[key].field_gadget_param['default'] = gadget.state.options.form_content[result[key].field_gadget_param.key];
}
}
}
}
}
rJS(window)
......@@ -66,7 +80,7 @@
var i;
if (result.data.rows.length) {
for (i = 0; i < result.data.rows.length; i += 1) {
loadFormContent(gadget, result.data.rows[i].value);
loadListboxContent(gadget, result.data.rows[i].value);
}
}
return result;
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>965.39414.4325.38963</string> </value>
<value> <string>966.2419.32114.61405</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1519050232.16</float>
<float>1523291888.74</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment