Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Changing selection type to single doesn't clear multiple selection

    Checked versions: v101p_2016-08-27_PowerEdition, v101p_2016-12-05_PowerEdition, v110p_2016-12-21_PowerEdition

    When I select multiple elements in ListGrid and change selectionType to single then ListGrid retains multiple selection.

    To reproduce:
    1. Go to http://www.smartclient.com/#multipleSelect
    2. Select first two elements, manually or by
    Code:
    countryList.selectRecord(0)
    countryList.selectRecord(1)
    3. Change selectionType to single:
    Code:
    countryList.setSelectionType("single")
    What I expect: selection stays only on first element or disappears (i.e. selection is consistent with selectionType)
    What happens: I have multiple selected items in grid which should allow for only one selected item.

    Can you change this behavior, or is it something I should handle in my code?

    #2
    The selectionType represents what the end user is allowed to do, and the current selection is not validated against it. It's important for some use cases that the current selection isn't forced to match the selectionType (such as selectionType:"none" plus a fixed, unmodifiable selection). So if you want the selection cleared or limited to one record at this moment, your code should do it.

    Comment

    Working...
    X