尝试使用 Multiselect kendoui 小部件包装器。服务器端过滤工作正常,但我无法在小部件初始化时填充初始值。你知道我在这里做错了什么吗?
<div class="container-div grid-tab-content-pane">
@(Html.Kendo().MultiSelect()
.Name(AMultiName)
.DataTextField("PrettyText")
.DataValueField("MapAbbreviation")
.Placeholder("Edit EMR maps...")
.Filter(FilterType.Contains)
.MinLength(3)
.AutoBind(false)
.HighlightFirst(true)
.Value(new []
{
new {PrettyText = "Abcdef",MapAbbreviation = "s01"},
new {PrettyText = "2nde obn", MapAbbreviation = "asdf012"}
})
.DataSource(ds => ds.Read(r=>r.Action("ReadMapOptions","EmrMappingKendo", new {Area="Messaging"})).ServerFiltering(true)).MinLength(3)
)
顺便说一句,我正在使用 kendoui dll 的 2013.2.918.340 版本
将 autobind 设置为 false 没有任何影响。
@(Html.Kendo().MultiSelect()
.Name(AMultiName)
.DataTextField("PrettyText")
.DataValueField("MapAbbreviation")
.Placeholder("Edit EMR maps...")
.AutoBind(true)
.Value(new []
{
new {PrettyText = "Abcdef",MapAbbreviation = "s01"},
new {PrettyText = "2nde obn", MapAbbreviation = "asdf012"}
})
.DataSource(ds => ds.Read(r=>r.Action("ReadMapOptions","EmrMappingKendo", new {Area="Messaging"})).ServerFiltering(true)).MinLength(3)
)