0

How to get data from web service

$('input.autocomplete').autocomplete({
        data: {
            "DELACOMBE": null,
            "DELAHEY": null,
            "DELAMERE": null,
        }
    });

1 Answers1

0

On the autocomplete docs. http://jqueryui.com/autocomplete/#remote there is a remote datasource and remote JSONP datasource example.

The basic of it is to add a source parameter to the endpoint that will return the autocomplete data.

$( "input.autocomplete" ).autocomplete({
  source: "api/autocompletedata",
  minLength: 2,
  select: function( event, ui ) {
    log( "Selected: " + ui.item.value + " aka " + ui.item.id );
  }
});
AndyC
  • 1,325
  • 1
  • 13
  • 23