如何在下拉列表中使用通配符kendo MVC? [英] How to do wildcard in dropdownlist kendo MVC?
本文介绍了如何在下拉列表中使用通配符kendo MVC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<div class="form-group">
@Html.LabelFor(model => model.Reviewer)
<div class="col-sm-9">
@(Html.Kendo().DropDownListFor(model => model.ReviewerId)
.Name("ReviewerId")
.Filter(FilterType.Contains)
.DataTextField("FullName")
.DataValueField("Id")
.OptionLabel("Select...")
.DataSource(source =>source
.Read(read => read.Action("Read","Reviewers").Data("filterReviewers"))
.ServerFiltering(true)
)
)
</div>
</div>
<script>
function resetReviewers(e) {
var ddl = $("#ReviewerId").data("kendoDropDownList");
if (ddl)
ddl.dataSource.read();
}
function filterReviewers(e) {
return {
subZoneId: $("#SubZoneId").data("kendoDropDownList").value(),
unitId: $("#UnitId").data("kendoDropDownList").value(),
}
}
</script>
我尝试了什么:
点击时在ddl和类型'm'字上,以'm'开头的记录列表将显示。
What I have tried:
something like, when click on ddl and type 'm' word, list of record started with 'm' will show.
推荐答案
(#ReviewerId)。data(kendoDropDownList) ;
if(ddl)
ddl.dataSource.read();
}
函数filterReviewers(e){
return {
subZoneId:
("#ReviewerId").data("kendoDropDownList"); if (ddl) ddl.dataSource.read(); } function filterReviewers(e) { return { subZoneId:
(#SubZoneId)。 (kendoDropDownList)。value(),
unitId:
("#SubZoneId").data("kendoDropDownList").value(), unitId:
(#UnitId)。data(kendoDropDownList)。value(),
}
}
< / script>
("#UnitId").data("kendoDropDownList").value(), } } </script>
我尝试了什么:
类似于,点击ddl并输入m字样时,将显示以m开头的记录列表。
What I have tried:
something like, when click on ddl and type 'm' word, list of record started with 'm' will show.
这篇关于如何在下拉列表中使用通配符kendo MVC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文