Unable to clear values programmatically when using virtualization

5 posts, 0 answers
  1. Ben
    Ben avatar
    1 posts
    Member since:
    Jan 2016

    Posted 04 Feb Link to this post

    I am trying to clear values in a MultiSelect widget that utilizes virtualization. If I filter to an item that is outside of the initial data load and attempt to clear the value via javascript I get the error "Uncaught TypeError: Cannot read property 'item' of undefined" after the MultiSelect refreshes. If I open the MultiSelect after selecting the value, the valueMapper function fires and the error does not occur when I clear the items. I am able to reproduce this error using a modified version of the virtualization demo. It seems like the difference between the two is that the paging variables are not reset when the window is closed. This sounds similar to a previous thread that related to the filter not being reset on close. 

    Here are the steps to reproduce:

    1. Filter the multi select to a value that is outside of the initial load.
    2. Select the value.
    3. Close the multi select list.
    4. Click the Clear Orders button.

    If I could manually fire the valueMapper function for the MultiSelect then I could create a workaround. Any suggestions on a workaround would be appreciated. My experience overall with the way virtualization is handled in this control suite has not been very good. It would be helpful to have more of the virtualization areas exposed similar to what is available in the dataSource object.

  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 08 Feb Link to this post

    Hello Ben,

    Thank you for bringing this to our attention. I logged this as a bug in Kendo UI Core bug tracker, you can use this link to follow the issue status.
    There is no easy workaround as the valueMapper function cannot be called manually. We will do our best to provide a fix as soon as possible.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
  4. Jayamurugan
    Jayamurugan avatar
    2 posts
    Member since:
    Mar 2016

    Posted 15 Mar in reply to Alexander Valchev Link to this post

    Hello Alexander Valchev,

    Also, if the selected value's index outside of the initial load, the selected values are getting duplicated.

     

    Regards,

    A.Jayamurugan

  5. Jayamurugan
    Jayamurugan avatar
    2 posts
    Member since:
    Mar 2016

    Posted 15 Mar in reply to Jayamurugan Link to this post

    sorry i missed to mentioned the below

    the selected values are getting duplicated when we delete it.

    steps.

    1. Select the options,

    2. save the selected options

    3. Load the selected options and set the selected options using below statements

      var operatorDropDown = $("#Operator").data("kendoMultiSelect");
            operatorDropDown.dataSource.filter({});
            operatorDropDown.value(currentQuery.operators);

    4. The values are getting selected

    5. Delete the selected options by clicking 'X' Button

    now see the duplicate options where their index is out of initial load.

     

    Regards,

    A.Jayamurugan

     

  6. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2877 posts

    Posted 18 Mar Link to this post

    Hello Jayamurugan,

    Is it possible to reproduce the issue in the MultiSelect virtualization page?

    I noticed that you are using the filter method of the dataSource to clear the filters. Controlling the widget's dataSource via the API methods in virtualization mode is not supported. Virtualization logic relies heavily on the dataSource which is why only the widget should modify it.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
Back to Top
Kendo UI is VS 2017 Ready