I have an autocomplete widget that works when I prepopulate the data from my ajax service but not when I use the DataSource Transport.
I am allowed to use json (dont need jsonp) but something else is the issue.
my table holds 60K employees so obviously I need to filter it down.
any ideas where I am making my mistake?
Thanks.
var dataSource = [];
var dataParam = [];
var remoteHost="http://www.myHost.com/Service.asmx/";
var remoteMethod ="getEmployees";
$(function () {
// method 1: remotely hosted ajax - works with AutoComplete
callAjax(remoteMethod, dataParam, onSuccess);
// method 2: Kendo Transport
$("#input").kendoAutoComplete({
minLength:3,
dataTextField:'Value',
dataSource:{
serverPaging:true,
pageSize:20,
contentType:'application/json; charset=utf-8',
type:'POST',
dataType:'json',
transport:{
read: remoteHost + remoteMethod
}
}
})
});
// SUPPORT FUNCTIONS FOR METHOD #1
function onSuccess(data, status){
alert("got data");
// dataSource=data.d;
// buildAutoComplete();
}
function buildAutoComplete() {
$("#input").kendoAutoComplete({
minLength: 2,
dataTextField: "Value",
dataSource: dataSource
});
}
I am allowed to use json (dont need jsonp) but something else is the issue.
my table holds 60K employees so obviously I need to filter it down.
any ideas where I am making my mistake?
Thanks.
var dataSource = [];
var dataParam = [];
var remoteHost="http://www.myHost.com/Service.asmx/";
var remoteMethod ="getEmployees";
$(function () {
// method 1: remotely hosted ajax - works with AutoComplete
callAjax(remoteMethod, dataParam, onSuccess);
// method 2: Kendo Transport
$("#input").kendoAutoComplete({
minLength:3,
dataTextField:'Value',
dataSource:{
serverPaging:true,
pageSize:20,
contentType:'application/json; charset=utf-8',
type:'POST',
dataType:'json',
transport:{
read: remoteHost + remoteMethod
}
}
})
});
// SUPPORT FUNCTIONS FOR METHOD #1
function onSuccess(data, status){
alert("got data");
// dataSource=data.d;
// buildAutoComplete();
}
function buildAutoComplete() {
$("#input").kendoAutoComplete({
minLength: 2,
dataTextField: "Value",
dataSource: dataSource
});
}