Commit 2b993f1f authored by Arnaud Fontaine's avatar Arnaud Fontaine

erp5_autocompletion_ui: Add JS ERP5Autocomplete() parameter to transform text...

erp5_autocompletion_ui: Add JS ERP5Autocomplete() parameter to transform text before sending AJAX request.

For example, if one wants to uppercase/lowercase the value entered by
end-user.
parent 351fcb1e
...@@ -47,6 +47,9 @@ $(function() {\n ...@@ -47,6 +47,9 @@ $(function() {\n
data.search_catalog_key = params.search_catalog_key;\n data.search_catalog_key = params.search_catalog_key;\n
\n \n
return function(request, response) {\n return function(request, response) {\n
if(params.transformSearchTextFunction)\n
request.term = params.transformSearchTextFunction(request.term);\n
\n
$.extend(data, {starts_with: request.term});\n $.extend(data, {starts_with: request.term});\n
$.ajax({\n $.ajax({\n
url: "<tal:block tal:replace="update_path" />",\n url: "<tal:block tal:replace="update_path" />",\n
......
2014-02-07 arnaud.fontaine
* Add JS ERP5Autocomplete() parameter to transform text before sending AJAX request.
2014-02-07 arnaud.fontaine 2014-02-07 arnaud.fontaine
* Autocompletion property value set to the field should be the one queried from the Catalog. * Autocompletion property value set to the field should be the one queried from the Catalog.
......
19 20
\ No newline at end of file \ No newline at end of file
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