+class JQueryAutoCompleteSearchWidget(JQueryAutoCompleteWidget):
+ def __init__(self, *args, **kwargs):
+ super(JQueryAutoCompleteSearchWidget, self).__init__(*args, **kwargs)
+
+ def render_js(self, field_id, options):
+ return u"""
+ $('#%s')
+ .autocomplete($.extend({
+ minLength: 0,
+ select: autocomplete_result_handler,
+ focus: function (ui, item) { return false; }
+ }, %s))
+ .data("autocomplete")._renderItem = autocomplete_format_item;
+ """ % (field_id, options)
+
+