[英]searchable Kendo dropdown in not working
我已经为员工代码使用了Kendo下拉列表,我想在此下拉列表中提供搜索功能,但是我在此下拉列表中使用了过滤器选项,但是当我当时使用过滤器选项并打开下拉菜单时,此选项不起作用当时已关闭,所以我无法在此下拉菜单中选择或搜索任何内容
@(Html.Kendo().DropDownList()
.Name("PCODE")
.HtmlAttributes(new { style = "width:100%;" })
.DataTextField("PCODE")
.DataValueField("EmpId")
.HtmlAttributes(new { @class = "kendo-Drop-PCode" })
.AutoBind(true)
.Filter("contain")
.DataSource(source =>
{
source.Read(read =>
read.Action("GetEmployeeList", "Common");
});
}))
看来您缺少开放的{
供阅读...
.DataSource(source =>
{
source.Read(read =>
read.Action("GetEmployeeList", "Common");
});
应该..
.DataSource(source =>
{
source.Read(read => {
read.Action("GetEmployeeList", "Common");
});
此外,过滤器应为.Filter("contains")
并且您可能需要.ServerFiltering(true);
设置。 您也可以使用.Filter("startswith")
作为过滤器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.