I'm moving an application from jQuery UI to kendo UI and have trouble getting kendo autocomplete do what the jquery ui autocomplte does.
The autocomplete queries the server with 3 input paramters and returns a json array of objects:
I can't figure how to setup/configure the kendo ui autocomplete (or combobox) datasource right.
Is the above possible?
The autocomplete queries the server with 3 input paramters and returns a json array of objects:
$('#reportLocation').autocomplete({
minLength: 4,
source: function (request, response) {
var country = $('#ddlLocationCountry').val();
$.ajax({
type: "POST",
url: "../../ws/wsLocations.asmx/GetLocationsBySearchString",
data: '{searchString: "%' + request.term.replace(/\ /g, '%') + '%", country: "' + country + '", includeInactive: "False"}',
contentType: "application/json; charset=utf-8",
dataType: "json",
dataFilter: function (data) { return data; },
success: function (data) {
$('#locationsByPosition').empty();
var json = $.parseJSON(data.d);
response($.map(json, function (item) { return { value: item.LName, id: item.LId} }));
},
error: function (result) {
alert('wsLocations.asmx/GetLocationsBySearchString failed: ' + result.status + ' ' + result.statusText);
}
});
},
select: function (e, ui) {
var lLocationId = ui.item.id;
$('#selectedLocationId').text(lLocationId);
}
});
Is the above possible?