Commits

Felipe Prenholato committed a5339bd

Allow custom autocomplete options passed via input data-autocomplete-opts to be used in autocomplete init.

  • Participants
  • Parent commits 5c685cd

Comments (0)

Files changed (1)

selectable/static/selectable/js/jquery.dj.selectable.js

 				$.getJSON(url, query, unwrapResponse);
             }
             // Create base auto-complete lookup
-            $(input).autocomplete({
+            opts = {
                 source: dataSource,
                 change: function (event, ui) {
                     $(input).removeClass('ui-state-error');
                     }
                     return self.select(ui.item, event);
                 }
-            }).addClass("ui-widget ui-widget-content ui-corner-all");
+            };
+            $.extend(opts, $(input).data('autocomplete-opts'));
+            $(input).autocomplete(opts).addClass("ui-widget ui-widget-content ui-corner-all");
             // Override the default auto-complete render.
             $(input).data("autocomplete")._renderItem = function (ul, item) {
                 /* Adds hook for additional formatting, allows HTML in the label,