Telerik Forums
KendoReact Forum
1 answer
38 views

Hello,

I'm trying to get client side virtual scrolling working in a multiselect with kendo-dropdowns-react-wrapper.

I have a multiselect containing a list of items (people) belonging to a group. The datasource is changing dynamically, according to the group selection in another dropdown list.

The same person may belong to different groups, but the groups may contain different people.

When I change the group selection, if a person is selected which belongs to both groups, I'd like the related multiselect item to remain selected.

This expected behavoiur works well with virtualization disabled, but when I enable virtualization I experience a strange behaviour.

Despite I have implemented the valueMapper function (that is called correctly and returns the correct new index list), when changing the datasource, the selected indices are not updated and the new items corresponding to the old indices are selected.

What am I missing to get it work with virtualization?

Below are the stackblitz examples.

To reproduce the problem:

  1. initially select "Clare Kline" and "Hamilton Holland" (the names are imaginary and created with a random generator) from the multiselect (records 1 and 3)
  2. Switch from "group 1" to "group 2" in the dropdownlist
  3. Verify that the multiselect selection has changed to "Hamilton Holland" only (who is the only person in common between the two groups): this works in non-virtualized version, while in the virtualized version "test2" and "test3" are selected.
  4. Select "group 1" again in the dropdownlist
  5. Verify that "Clare Kline" and "Hamilton Holland"  are selected again

Without virtual scrolling: https://stackblitz.com/edit/react-ts-fnfdar?file=index.tsx

With virtual scrolling; https://stackblitz.com/edit/react-ts-qb16wa?file=index.tsx

 

Stefan
Telerik team
 answered on 14 Dec 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?