This is a migrated thread and some comments may be shown as answers.

Multi select change event not firing

4 Answers 1740 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Jaesoon
Top achievements
Rank 1
Jaesoon asked on 03 Jan 2016, 11:28 PM

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

4 Answers, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 05 Jan 2016, 05:02 PM
Hello,

I reviewed your code and there is no obvious reason for this behavior. The same code works on my side and on the online example also.

 Can you verify if some javascript error occurs when select or delete item from the list? 

Regards,
Milena
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jaesoon
Top achievements
Rank 1
answered on 08 Jan 2016, 10:08 AM

Hi Milena

 

 

Unfortunately, there are no errors showing when i run the controls.

However i have pinpointed where the problem seems to be occurring,

After commenting out this section:

Virtual(v => v.ItemHeight(26).ValueMapper("itemsValueMapper"))

The change event is firing again for me.

 

If i'm not mistaken, this is needed for virtualising the data source. Since there's going to be a lot of items in this list, i would really like to implement the virtualisation feature.

 

I am currently using kendo mvc 2015.3.1111

 

Thanks

0
Accepted
Alexander Valchev
Telerik team
answered on 12 Jan 2016, 03:10 PM
Hi Jaesoon,

This is a known issue which is already fixed. The fix will be available in the Q1 release which is due to be published at the end of this week. For more information see: https://github.com/telerik/kendo-ui-core/issues/1342

Regards,
Alexander Valchev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jaesoon
Top achievements
Rank 1
answered on 12 Jan 2016, 08:46 PM

Hi Alexander

 

Alright, sounds good, i look forward to using it when the fix comes out.

 

Thanks

Tags
MultiSelect
Asked by
Jaesoon
Top achievements
Rank 1
Answers by
Milena
Telerik team
Jaesoon
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or