Selected Tags are lost when Filter is applied to Kendo MultiSelect Control

2 posts, 0 answers
  1. Sally
    Sally avatar
    1 posts
    Member since:
    Mar 2015

    Posted 17 Oct Link to this post

    I need to apply a filter to a MultiSelect control that already has selected items within Kendo-UI 2016 R3 SP1 (2016.3.1028) . I am able to apply the filter but once I do all of the selected items are no longer tagged as selected even though they still exist in the list.
    I have tried using every version of Kendo-UI (the latest being Kendo UI 2019 R3, 2019.3.917) to see if a patch has been created to resolve this issue. None work. I have tried amending the "onFiltering" method as is described in the following post:

    https://www.telerik.com/forums/how-to-hold-selected-elements-in-multiselect-after-filtering

    Nothing has worked to this point.  I have created a snippet in Dojo that shows this exact issue:

    https://dojo.telerik.com/aWiviPAw

    Please note that within this example "Star Wars: The Empire Strikes Back" should be tagged as selected. If you click on the drop down list it is listed as selected. However, it is not tagged as selected when the drop down list is minimized even though it is selected. Please also note that if I make a change and remove the filter from the MultiSelect control that it will be correctly tagged as selected.

    If anyone can offer a workaround or point to a patch that will resolve this issue then I would be very grateful.

  2. Petar
    Admin
    Petar avatar
    99 posts

    Posted 21 Oct Link to this post

    Hi Sally,

    If I am understanding the case correctly, the desired functionality can be implemented by adding the following script as noted in this MultiSelect DataSource manual filtering demo:

    <!-- IMPORTANT: Update filter state of the widget -->
    ms.listView.setDSFilter(ms.dataSource.filter());

    Please check the edited versions of the Dojo you've sent me: 

    In both of the above demos, after adding the above code line, the filtered items are being correctly selected and after the initial selection, we can continue selecting/deselecting all MultiSelect items. 

    Please check the linked Dojo projects and let me know if they demonstrate the functionality you want to acheive.

    Regards,
    Petar
    Progress Telerik

    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top