Im having problems getting the multi select change event to fire.
Initially i thought it could be something to do with my functions so i've tried copying all the event functions exactly as shown on the demo page.
Using the multi select box, i can see all the events are firing EXCEPT for the change event. (e.g. open, selected, closed, databound works)
Is there any reason why only the change function is not firing? I need the change function as theres logic to be done when an item is selected or deleted from the list.
This is what my multi select looks like:
01.
@(Html.Kendo().MultiSelectFor(m => m.Ids)
02.
.DataTextField("Description")
03.
.DataValueField("Id")
04.
.Filter("contains")
05.
.Placeholder("Please select an item...")
06.
.Events(e => e.Change("onChange").Select("onSelect").Open("onOpen").Close("onClose").DataBound("onDataBound").Filtering("onFiltering"))
07.
.DataSource(source =>
08.
{
09.
source.Custom()
10.
.ServerFiltering(true)
11.
.ServerPaging(true)
12.
.PageSize(80)
13.
.Type("aspnetmvc-ajax")
14.
.Transport(transport =>
15.
{
16.
transport.Read("GetItems", "Items");
17.
})
18.
.Schema(schema =>
19.
{
20.
schema.Data("Data").Total("Total");
21.
});
22.
})
23.
.Virtual(v => v.ItemHeight(26).ValueMapper("itemsValueMapper"))
24.
.Value(Model.Items)
25.
)
And javascript is just your basic event functions
01.
function onOpen() {
02.
console.log("event: open");
03.
}
04.
05.
function onClose() {
06.
console.log("event: close");
07.
}
08.
09.
function onChange() {
10.
console.log("event: change");
11.
}
12.
13.
function onDataBound() {
14.
console.log("event: dataBound");
15.
}
16.
17.
function onFiltering() {
18.
console.log("event: filtering");
19.
}
20.
21.
function onSelect(e) {
22.
var dataItem = this.dataSource.view()[e.item.index()];
23.
console.log("event :: select (" + dataItem.Text + " : " + dataItem.Value + ")");
24.
}
Thanks