Commit 735f63bf authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Listbox: precheck lines

parent 3bba8c31
...@@ -120,6 +120,9 @@ ...@@ -120,6 +120,9 @@
sub_element.setAttribute('type', 'checkbox'); sub_element.setAttribute('type', 'checkbox');
sub_element.setAttribute('class', 'hide_element'); sub_element.setAttribute('class', 'hide_element');
sub_element.setAttribute('id', 'listbox_line_' + row.uid); sub_element.setAttribute('id', 'listbox_line_' + row.uid);
if (row.checked) {
sub_element.setAttribute('checked', 'checked');
}
td_element.appendChild(sub_element); td_element.appendChild(sub_element);
} }
...@@ -483,6 +486,8 @@ ...@@ -483,6 +486,8 @@
sort_list_json: JSON.stringify(result_list[1] || field_json.sort.map(jioize_sort)), sort_list_json: JSON.stringify(result_list[1] || field_json.sort.map(jioize_sort)),
selection_name: field_json.selection_name, selection_name: field_json.selection_name,
checked_uid_list: field_json.checked_uid_list || [],
show_anchor: field_json.show_anchor, show_anchor: field_json.show_anchor,
show_stat: field_json.show_stat, show_stat: field_json.show_stat,
show_count: field_json.show_count, show_count: field_json.show_count,
...@@ -944,6 +949,7 @@ ...@@ -944,6 +949,7 @@
cell_list, cell_list,
url_value, url_value,
index = 0, index = 0,
uid,
setNonEditable = function (cell) {cell.editable = false; }; setNonEditable = function (cell) {cell.editable = false; };
// reset list of UIDs of editable sub-documents // reset list of UIDs of editable sub-documents
gadget.props.listbox_uid_dict = { gadget.props.listbox_uid_dict = {
...@@ -994,8 +1000,10 @@ ...@@ -994,8 +1000,10 @@
// if the document does not have listbox_uid:list then no gadget should be editable // if the document does not have listbox_uid:list then no gadget should be editable
cell_list.forEach(setNonEditable); cell_list.forEach(setNonEditable);
} }
uid = buildFieldGadgetParam(allDocs_result.data.rows[i].value.uid).default;
row_list.push({ row_list.push({
"uid": buildFieldGadgetParam(allDocs_result.data.rows[i].value.uid).default, "uid": uid,
"checked": (gadget.state.checked_uid_list.indexOf(uid) !== -1),
"jump": line_link_list[i], "jump": line_link_list[i],
"cell_list": cell_list, "cell_list": cell_list,
"line_icon": gadget.state.line_icon "line_icon": gadget.state.line_icon
......
...@@ -240,7 +240,7 @@ ...@@ -240,7 +240,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>979.21897.21030.48025</string> </value> <value> <string>979.27738.39874.9932</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1572276156.44</float> <float>1572276942.85</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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