Multi select change event not firing

5 posts, 1 answers
  1. Jaesoon
    Jaesoon avatar
    51 posts
    Member since:
    Oct 2012

    Posted 03 Jan Link to this post

    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

  2. Milena
    Admin
    Milena avatar
    224 posts

    Posted 05 Jan Link to this post

    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
  3. UI for ASP.NET MVC is VS 2017 Ready
  4. Jaesoon
    Jaesoon avatar
    51 posts
    Member since:
    Oct 2012

    Posted 08 Jan in reply to Milena Link to this post

    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

  5. Answer
    Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 12 Jan Link to this post

    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
  6. Jaesoon
    Jaesoon avatar
    51 posts
    Member since:
    Oct 2012

    Posted 12 Jan in reply to Alexander Valchev Link to this post

    Hi Alexander

     

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

     

    Thanks

Back to Top
UI for ASP.NET MVC is VS 2017 Ready