I use jquery-ui plugin and I need to load data from a remote url. I used following code and it doesnt work. Can any one help me.
$( "#metadata" ).combobox({
source: "metadata/retrievejson",
});
Thank you
I use jquery-ui plugin and I need to load data from a remote url. I used following code and it doesnt work. Can any one help me.
$( "#metadata" ).combobox({
source: "metadata/retrievejson",
});
Thank you
you should look at this link in the doc. It shows how to retrieve data asynchronously.
your code should look something like this
$( "#metadata" ).combobox({
source: function( request, response ) {
$.ajax({
url: "http://ws.geonames.org/searchJSON",
dataType: "jsonp",
success: function( data ) {
response(data);
}
});
}
});
The autocomplete plugin works as stated by Amin Eshaq, however, the combobox (1) does not have support for remote data, since it's using selectbox.
You could consider extending autocomplete with a button triggering the search event with the text from the autocomplete field.
.autocomplete("search", [value])