ie.geologyidea.com
More

How to append result to Geocoder text box using ArcGIS JavaScript API?

How to append result to Geocoder text box using ArcGIS JavaScript API?


We are searching data for your request:

Forums and discussions:
Manuals and reference books:
Data from registers:
Wait the end of the search in all databases.
Upon completion, a link will appear to access the found materials.


I want to append result of a custom search in a Geocoder text box in ArcGIS JavaScript API by overriding the default result.

I have written the below code for this, but I am not getting a satisfactory result.

                

anyone any suggestion?


Yes i found solution to this problem basically I can append the data which i am receiving using Jquery.

After all it is just an HTML!

But still there can be a better solution please do post it.

$.ajax({ dataType: "json", type: 'POST', //url: 'http://11.66.22.44/Geocoder/Query.aspx', url: 'Query.aspx', //crossdomain: true, timeout: 500000, cache: true, data: { RequestType: "AutoComplete", AutoCompleteValue: $("#search_input").val() }, success: function (data) { //$('input.suggest-user').removeClass('ui-autocomplete-loading'); // hide loading image var actualLength = $(".esriGeocoderResults ul").length; if (data != null) { //response(data); if ($(".esriGeocoderResults ul").length == 0) { $(".esriGeocoderResults").append('
    '); } if ($("#search").hasClass("esriGeocoderResultsOpen") == false) { $("#search").addClass("esriGeocoderResultsOpen"); } $(".esriGeocoderResults").css("display", "block"); for (var index = 0; index < data.length; index++) { if ($(".esriGeocoderResults ul").text().indexOf(data[index]) == -1) { if (actualLength % 2 == 0) { $(".esriGeocoderResults ul").append(''); actualLength++; } else { $(".esriGeocoderResults ul").append(''); actualLength++; } } } $(".esriGeocoderResults ul").bind(); //alert($(".esriGeocoderResults ul").length); //$(".esriGeocoderResults ul").append('
  • Message Center
  • '); } }, error: function (data) { alert("error:" + data.statusText); //$('input.suggest-user').removeClass('ui-autocomplete-loading'); } });