我在asp.net mvc项目中有这个多选项:
<div class="demo-section user-selection">
<h3 class="title">1. Select one or more Users</h3>
@(Html.Kendo().MultiSelect() //user multi select
.Name("customers")
.DataTextField("givenName")
.DataValueField("description")
.Events(events => events.Change("Selection"))
.DataSource(source =>
{
source.Custom()
.ServerFiltering(true)
.ServerPaging(true)
.PageSize(5)
.Type("aspnetmvc-ajax") //Set this type if you want to use DataSourceRequest and ToDataSourceResult instances
.Transport(transport =>
{
transport.Read("Virtualization_Read", "Home");
})
.Schema(schema =>
{
schema.Data("Data")
.Total("Total");
});
})
.Height(400)
.Virtual(v => v.ItemHeight(55).ValueMapper("valueMapper"))
.HeaderTemplate("<div class=\"dropdown-header dropdown_Users\">" +
"<span class=\"k-widget k-header\">Photo</span>" +
"<span class=\"k-widget k-header\">Contact info</span>" +
"</div>")
.ItemTemplate("<span class=\"k-state-default item-user userPic\"><img class=\"userPhoto\" src=\"" + @System.Configuration.ConfigurationManager.AppSettings["BaseUrl"] + "user/image?userIid=#:data.IID#\" /></span>" +
"<span class=\"k-state-default item-user \"><h3>#: data.givenName # #: data.sn #</h3><p>#: data.description #</p></span>")
)
</div>
然后我有一个名为Selection
的函数 function Selection() {
console.log("sel");
...
}
我的问题是,当我为多选项选择用户时,该函数不会被调用。我在控制台中看不到“sel”。如果我将事件更改为DataBound它会触发,但更改事件不会 怎么了?