There is combobox with autocomplete enabled. How to pass JSON data as source for this combobox?
Upd. I\'ve found partial answer here - it allows me
I just used next construction: 1. In combobox.js I put code from example that appears on https://jqueryui.com/autocomplete/#combobox and had changed _create & _createAutocomplete functions as follows:
_create: function() {
this.wrapper = $( "" )
.addClass( "custom-combobox" )
.insertAfter( this.element );
var autocompleteSetup = this.options.autocompleteSetup;
this.element.hide();
this._createAutocomplete( autocompleteSetup );
this._createShowAllButton();
}
_createAutocomplete: function(setupObject) {
...
this.input = $( "" )
.appendTo( this.wrapper )
.val( value )
.attr( "title", "" )
.addClass( "custom-combobox-input ui-widget ui-widget-content ui-state-default ui-corner-left" )
.autocomplete(setupObject)...
From page code where I'm creating the combo I am calling the create code as follows:
var options = { autocompleteSetup : { delay: 100, minLength: 2, source: "http://your/data/hook/url" } }; $( "#subzero" ).combobox(options);