我如何在按钮单击(btnSelect)时获得剑道自动完成的选定值
$(document).ready(function () {
$("#titles").kendoAutoComplete({
minLength: 3,
dataTextField: "SDesc",
dataValueField: "RefID",
template: '${ data.SDesc } ' + '(' + '${ data.SDate }' + ')',
dataSource: {
type: "odata",
serverFiltering: true,
serverPaging: true,
pageSize: 20,
transport: {
read: "http://localhost:54329/HH_WcfDataService.svc/Product"
}
}
});
$('#btnSelect').click(function (e){
var onSelect = function(e) {
// access the selected item via e.item (jQuery object)
};
// attach select event handler via bind()
$("#titles").data("kendoAutoComplete").bind("select", onSelect);
// detach select event handler via unbind()
$("#titles").data("kendoAutoComplete").unbind("select", onSelect);
});
});