Commit 1aa180e3 authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Do not generate query string starting with 'AND'

parent 35ea9341
......@@ -197,7 +197,7 @@
original_tfoot = props.element.querySelector(\'tfoot\'),\n
tbody = document.createElement("tbody"),\n
url_query = props.extended_search,\n
query_string = "",\n
query_string = new URI(field_json.query).query(true).query,\n
lines = field_json.lines,\n
select_list = [],\n
dataset,\n
......@@ -214,7 +214,11 @@
\n
if (url_query) {\n
//query_string = field_json.column_list.reduce(buildQueryString, \' AND (\').replace(new RegExp("OR " + \'$\'), \')\');\n
if (query_string) {\n
query_string = \' AND \' + url_query;\n
} else {\n
query_string = url_query;\n
}\n
}\n
\n
for (i = 0; i < field_json.column_list.length; i += 1) {\n
......@@ -224,7 +228,7 @@
return gadget.jio_allDocs({\n
// XXX Not jIO compatible, but until a better api is found...\n
"list_method_template": field_json.list_method_template,\n
"query": new URI(field_json.query).query(true).query + query_string,\n
"query": query_string,\n
"limit": [begin_from, lines + 1],\n
"select_list": select_list\n
}).push(function (result) {\n
......@@ -604,7 +608,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.44927.40202.16725</string> </value>
<value> <string>946.56368.46897.8174</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -622,7 +626,7 @@
</tuple>
<state>
<tuple>
<float>1445939419.71</float>
<float>1446565852.84</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