Commit f5bbbaa5 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: add "show all" command

parent 95f7985a
......@@ -219,7 +219,6 @@
dataset,\n
counter,\n
hide_item = gadget.props.hide_item,\n
tmp_hide_item,\n
sort_list = gadget.props.sort_list || [],\n
i,\n
j,\n
......@@ -499,7 +498,6 @@
})\n
.declareService(function () {\n
var gadget = this,\n
selected_uid_list,\n
selected_uid_query,\n
hide_form = gadget.props.element.querySelector(".hide_form");\n
/* hide form */\n
......@@ -513,13 +511,16 @@
i,\n
th,\n
hide_form_elements,\n
hide_submit_form = document.createElement("form"),\n
hide_show_all = document.createElement("button"),\n
checkbox;\n
\n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element:checked");\n
\n
if (hide_form_elements.length > 0) {\n
selected_uid_query = "catalog.uid: (";\n
for (i = 0; i < hide_form_elements.length; i += 1) {\n
selected_uid_query += hide_form_elements[i].parentElement.getAttribute("value");\n
hide_form_elements[i].parentElement.removeChild(hide_form_elements[i]);\n
if (i !== hide_form_elements.length - 1) {\n
selected_uid_query += ", ";\n
} else {\n
......@@ -527,15 +528,36 @@
}\n
}\n
\n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element");\n
for (i = 0; i < hide_form_elements.length; i += 1) {\n
hide_form_elements[i].parentElement.removeChild(hide_form_elements[i]);\n
}\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "",\n
"sort_list": gadget.props.sort_list || "",\n
"hide_item": selected_uid_query});\n
}\n
\n
hide_show_all.setAttribute("type", "submit");\n
hide_show_all.textContent = "Show All";\n
hide_show_all.className = "ui-btn responsive ui-last-child";\n
hide_submit_form.appendChild(hide_show_all);\n
th = document.createElement("th");\n
\n
th.setAttribute("class", "hide_form_element");\n
th.appendChild(hide_submit_form);\n
loopEventListener(\n
hide_submit_form,\n
"submit",\n
false,\n
function () {\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "",\n
"sort_list": gadget.props.sort_list || ""});\n
}\n
);\n
thead_tr.insertBefore(th, thead_tr.firstChild);\n
for (i = 0; i < tr_list.length; i += 1) {\n
checkbox = document.createElement("input");\n
......@@ -725,7 +747,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.64123.65425.24012</string> </value>
<value> <string>945.64213.19729.53691</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -743,7 +765,7 @@
</tuple>
<state>
<tuple>
<float>1443185166.52</float>
<float>1443190830.65</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