現在、Kendo UI に問題があります。現時点では、従業員を取得するために使用するオートコンプリートがあります。私が抱えている問題は、'John Smith' などの複数の単語 (姓名) でオートコンプリートを機能させたいということです。現在、「john」と入力すると、オートコンプリートが正常に機能し、「john」という単語を含む他の名前とともに、下のドロップダウンに「John smith」が表示されます。姓「smith」を入力し、「john smith」を選択するオプションがある場合、同じことが問題なく機能します。私がやろうとしているのは、名前全体が「John Smith」に入力されているときに、ユーザーが John smith を選択できるようにすることです。これは、2 つの単語を検索することを意味します。誰でも助けることができますか?私は私のコードを以下に置きます。
ありがとう。
//Autocomplete FeeEarner
$("#FeeEarnerEmailSend").kendoAutoComplete({
dataSource: new kendo.data.DataSource({
serverFiltering: true,
transport: {
read: "/" + prefix + "/api/Session/GetEmployees",
parameterMap: function () {
return { id: $("#FeeEarnerEmailSend").data("kendoAutoComplete").value() };
}
}
}),
dataTextField: 'FullName',
filter: "contains",
//placeholder: "Search...",
minLength: 3,
suggest: true,
select: function (e) {
var employeeAutoComplete = e.sender;
// this var is used in the Search button click event
selectedEmployeeDataItem = employeeAutoComplete.dataItem(e.item.index());
},
change: function () {
if ($.trim($("#FeeEarnerEmailSend").val()) == "") {
selectedEmployeeDataItem = null;
}
},
dataBound: function (e) {
selectedEmployeeDataItem = e.sender.dataItem(0);
}
});