我无法在 kendo 自动完成小部件向服务发送 ajax 请求之前更改 url 在我更改参数映射中的 url 之前它已经先加载。Kendo 会自动将搜索字符串添加到 URL。当我按下一个键时,我可以更改 url,但数据绑定到使用 prev 请求数据自动完成。任何人都可以建议我找到更改网址的正确位置。
$('#AddressSearchTerm').kendoAutoComplete({
dataTextField:"Text"
filter: "contains",
minLength: 2,
delay: 700,
dataSource: {
type: "json",
serverFiltering: true,
transport: {
read: "http://services.postcodeanywhere.co.uk/CapturePlus/Interactive/Find/v2.00/json3.ws?SearchTerm=a&LastId=&SearchFor=Everything&Country=GBR&LanguagePreference=EN",
type: "POST",
dataType: "jsonp",
parameterMap: function (options, operation) {
var p = $('#AddressSearchTerm').data("kendoAutoComplete");
var serviceurl1 = "http://services.postcodeanywhere.co.uk/CapturePlus/Interactive/Find/v2.00/json3.ws?SearchTerm=" + options.filter.filters[0].value + "&LastId=&SearchFor=Everything&Country=GBR&LanguagePreference=EN";
p.dataSource.transport.options.read.url = serviceurl1;
}
},
schema:{data:"Items"}
}
});