Announcement

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

    Inconsistent record drag-drop behavior when shift-clicking

    Hi,

    In an unsorted ListGrid where records can be reordered through drag and drop, the order of the dropped records depends on where the shift-click to select the range was started.
    This is visible in the Drag Tiles (move) showcase (version 13.op build 2022-11-28) using the latest version of Chrome (Version 107.0.5304.108 (Official Build) (64-bit)).

    Steps to reproduce:
    • Click the first record
    • Shift-click the third record
    • Drag and drop those records somewhere else
    • The dropped records stay in their original order: 1, 2, 3
    VS
    • Click the third record
    • Shift-click the first record
    • Drag and drop those records somewhere else
    • The bottom record in the original selection is now moved to the top, the order is: 3, 1, 2
    What did I expect to happen:
    I expect the relative order of drag and dropped records to stay the same in an unordered ListGrid.
    This is true for all methods of selecting a set of records except when shift-clicking from bottom to top.


    Thanks

    #2
    Interesting and rather nuanced observation!

    This default behavior basically has to do with how the selection is tracked. In the latter case, the first record to be selected is the third record visually, then other records are added to the selection according to the order of mouse event processing. There is no specific order for selection records, it's just an unordered set.

    If you want to maintain a definite order, use this approach:

    https://smartclient.com/smartgwtee/s...rable_ListGrid

    Otherwise, two approaches:

    1. override the default drop behavior and insert records as you like

    or

    2. use our Feature Sponsorship program to add the behavior you want. It might be a variant on the sample above

    Comment

    Working...
    X