qooxdoo / qooxdoo

qooxdoo - Universal JavaScript Framework
http://qooxdoo.org
Other
764 stars 260 forks source link

Treevirtual - reselect all selections, not just the last one #10606

Closed rad-pat closed 11 months ago

rad-pat commented 12 months ago

I discovered a bug with the Treevirtual whereby it does not reselect all the previous selections when refreshed (in multi-selection mode). This is already apparent in the DemoBrowser where 2 selections are made in the set-up, but upon setting the datamodel, only one selection is actually displayed.

Demo Browser where it fails to select 2 nodes http://qooxdoo.org/qxl.demobrowser/#treevirtual~TreeVirtual_Selections.html

The fix uses the batchMode of the selectionModel to add each of the selections before ultimately firing the changeSelection event once all selections are added. For single selection mode, the effect will be the same as before where the last of the selections would be selected.

This is a link to a Playground example of the above Demo Browser with my fix applied: https://tinyurl.com/y2jdc8v7