Ho creato il completamento automatico dell'interfaccia utente jQuery che funziona molto bene. Ma il mio requisito è che ciò che mostro come lista dovrebbe anche selezionare lo stesso nella casella di testo. Ma non sta selezionando Per esempio lista come XXX (XYZ) ma quando seleziono seleziono solo XXX non XXX (XYZ) quello che mi manca !!jQuery evento selezione completamento automatico
function getDeptStations() {
$("#txDestination").autocomplete({
source: function (request, response) {
var term = request.term;
var Query = "";
if (lang === "en")
Query = "City_Name_EN";
else if (lang === "fr")
Query = "City_Name_FR";
if (lang === "de")
Query = "City_Name_DE";
if (lang === "ar")
Query = "City_Name_AR";
var requestUri = "/_api/lists/getbytitle('Stations')/items?$select=City_Code," + Query + "&$filter=startswith(" + Query + ",'" + term + "')";
$.ajax({
url: requestUri,
type: "GET",
async: false,
headers: {
"ACCEPT": "application/json;odata=verbose"
}
}).done(function (data) {
if (data.d.results) {
response($.map(eval(data.d.results), function (item) {
return {
label: item[Query] + " (" + item.City_Code + ")",
value: item[Query],
id: item[Query]
}
}));
}
else {
}
});
},
response: function (event, ui) {
if (!ui.content.length) {
var noResult = { value: "", label: "No cities matching your request" };
ui.content.push(noResult);
}
},
select: function (event, ui) {
$("#txDestination").val(ui.item.label);
cityID = ui.item.id;
},
minLength: 1
});
}
Quali sono le librerie che dobbiamo usare per jQuery completamento automatico selezionare event.Can voi si prega di controllare questo link e vedere cosa c'è di sbagliato nel mio codice http://stackoverflow.com/questions/36860915/what-event-is-used-in-order-to-show-an-alert-message-on-selecting- a-value-in-the/36861040? noredirect = 1 # comment61292092_36861040 –