Commit 9fa5771d authored by Arnaud Fontaine's avatar Arnaud Fontaine

RelationField: Support older version of jQuery UI (<= 1.9) for autocompletion.

parent 35ed3fa9
......@@ -381,9 +381,16 @@ class MultiRelationStringFieldWidget(Widget.LinesTextAreaWidget,
return """
<script type="text/javascript">
$(document).ready(function() {
$("input[name='%s']").ERP5Autocomplete({search_portal_type: %s,
search_catalog_key: "%s"})
.data("ui-autocomplete")._renderItem = function(ul, item) {
var autocomplete = $("input[name='%s']").ERP5Autocomplete({search_portal_type: %s,
search_catalog_key: "%s"});
autocomplete = autocomplete.data("autocomplete") ?
// jQuery UI <= 1.8
autocomplete.data("autocomplete") :
// jQuery UI > 1.8
autocomplete.data("ui-autocomplete");
autocomplete._renderItem = function(ul, item) {
return $("<li></li>").data("item.autocomplete", item)
.append("<a><b>" +
item.label +
......
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