Hi guys, Robert Scheitlin, GISP, Ken Buja,
Sorry, last question about that i marked as assumed answered and had to create new one.
I have autocomplete search widget generated from JQUERY.
Autocomplete works for some features ( it is street names ), but some features didn't appears in autocomplete, while if i write in text field name of a street manually ( it should be full name, including , . ! etc) it finds the street.
When i check it on server side it does the same, if GEOMETRY is TRUE some features is missing, if FALSE again some features is still missing, no full features is response.
Here is a code i use:
/Autocomplete
$(function () {
var array = []
queryTask = new QueryTask(myURL);
query = new Query();
query.returnGeometry = false;
query.outFields = ["street_names"];
query.where = "1=1";
queryTask.execute(query).then(showResults);
function showResults(results) {
var resultItems = [];
var resultCount = results.features.length;
for (var i = 0; i < resultCount; i++) {
var featureAttributes = results.features[i].attributes;
for (var attr in featureAttributes) {
tags = String(featureAttributes[attr]);
resultItems.push(tags);
}
}
sorted = resultItems.sort()
var uniqueNames = [];
$.each(sorted, function (i, el) {
if ($.inArray(el, uniqueNames) === -1) uniqueNames.push(el);
});
array = uniqueNames
var availableTags = array;
$("#searchInput").autocomplete({
source: function (request, response) {
var results = $.ui.autocomplete.filter(availableTags, request.term);
response(results.slice(0, 20));
}
});
}
});