我正在使用剑道多选控件,并使用 Jquery 设置它的值。将剑道窗口添加到表单后,Jquery 代码找不到多选控件,并给出错误“无法设置未定义的值”。
<div id="dialog"> @(Html.Kendo().Window() .Name("ActionItemWindow").Title("Add New Author").Visible(false).Modal(true).Width(1000).Draggable(true).Actions(actions => actions.Maximize().Close()).LoadContentFrom("/Author/_AddNewAuthor"))</div>
@(Html.Kendo().MultiSelect().Name("authorsmultiselect").Placeholder("Select author..").MinLength(4).DataSource(source =>{source.Read(read => { read.Action("GetAuthorsList", "Author"); }).ServerFiltering(false);}).DataTextField("Email").DataValueField("ID"))<input id="Button1" type="button" onclick="showActionItemDetails();" value="button" />
<script>function showActionItemDetails() {var multiselect = $("#authorsmultiselect").data("kendoMultiSelect");multiselect.value("1");}</script>