Commit 9e56822f authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: use Jio Query to build search query

parent 3c50cd4d
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
/*jslint indent: 2, maxerr: 3, nomen: true */\n /*jslint indent: 2, maxerr: 3, nomen: true */\n
/*global window, document, rJS, URI, RSVP, UriTemplate, QueryFactory, loopEventListener, Query */\n /*global window, document, rJS, URI, RSVP, UriTemplate, QueryFactory, loopEventListener, Query, SimpleQuery, ComplexQuery*/\n
(function (window, document, rJS, URI, RSVP, UriTemplate) {\n (function (window, document, rJS, URI, RSVP, UriTemplate) {\n
"use strict";\n "use strict";\n
\n \n
...@@ -513,20 +513,24 @@ ...@@ -513,20 +513,24 @@
hide_form_elements,\n hide_form_elements,\n
hide_submit_form = document.createElement("form"),\n hide_submit_form = document.createElement("form"),\n
hide_show_all = document.createElement("button"),\n hide_show_all = document.createElement("button"),\n
query_list = [],\n
checkbox;\n checkbox;\n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element:checked");\n hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element:checked");\n
\n \n
if (hide_form_elements.length > 0) {\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 for (i = 0; i < hide_form_elements.length; i += 1) {\n
selected_uid_query += hide_form_elements[i].parentElement.getAttribute("value");\n query_list.push(new SimpleQuery({\n
hide_form_elements[i].parentElement.removeChild(hide_form_elements[i]);\n key: "catalog.uid",\n
if (i !== hide_form_elements.length - 1) {\n type: "simple",\n
selected_uid_query += ", ";\n value: hide_form_elements[i].parentElement.getAttribute("value")\n
} else {\n }));\n
selected_uid_query += ")";\n
}\n
}\n }\n
\n
selected_uid_query = new ComplexQuery({\n
operator: "OR",\n
query_list: query_list,\n
type: "complex"\n
});\n
\n \n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element");\n hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element");\n
for (i = 0; i < hide_form_elements.length; i += 1) {\n for (i = 0; i < hide_form_elements.length; i += 1) {\n
...@@ -536,7 +540,7 @@ ...@@ -536,7 +540,7 @@
"extended_search": gadget.props.extended_search || "",\n "extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "",\n "domain_tree": gadget.props.domain_tree || "",\n
"sort_list": gadget.props.sort_list || "",\n "sort_list": gadget.props.sort_list || "",\n
"hide_item": selected_uid_query});\n "hide_item": Query.objectToSearchText(selected_uid_query)});\n
}\n }\n
\n \n
hide_show_all.setAttribute("type", "submit");\n hide_show_all.setAttribute("type", "submit");\n
...@@ -747,7 +751,7 @@ ...@@ -747,7 +751,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>945.64213.19729.53691</string> </value> <value> <string>946.2679.13824.6365</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -765,7 +769,7 @@ ...@@ -765,7 +769,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1443190830.65</float> <float>1443430519.63</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