Grid re-sorts itself after item in grid is selected

Certified Senior Developer

I have a simple interface rule that displays a grid of items sorted by an expiration date. The grid uses a query rule and a CDT for the items listed. My issue is that once the user selects one of the items, that item drops to the bottom of the list. Any idea why it would do this? I don't have any errors; the query rule does not include a 'sort by' and the selection part works just fine. I would also like the user to be able to sort on the other columns (which doesn't work now) but the most troubling issue is that the selected item moves to the bottom of the grid.

GridResortIssue.txt

OriginalPostID-225683

OriginalPostID-225683

  Discussion posts and replies are publicly visible

Parents
  • There's a notorious bug that I've seen many times. If the field that you're sorting by isn't completely unique, you might occasionally see the grid resort itself. Every time you click on anything the grid is remade. If you don't change the paging info, it's remade with the same paging info as before. Mostly you won't notice, but occasionally it changes. Appian switched from a stable Merge sort to a faster Quick Sort algorithm, and that has a random pivot that can sometimes randomly swap values that are the same.

    I might have fixed it once. I created a local! called old paging info. If the old paging info was the same as the paging info, I set the dataset to {}. If they were different, I ran the todataset function as normal and set the old paging info equal to the paging info. That seemed to work, i.e. I was unable to reproduce the bug, but it might have still been there hiding.
Reply
  • There's a notorious bug that I've seen many times. If the field that you're sorting by isn't completely unique, you might occasionally see the grid resort itself. Every time you click on anything the grid is remade. If you don't change the paging info, it's remade with the same paging info as before. Mostly you won't notice, but occasionally it changes. Appian switched from a stable Merge sort to a faster Quick Sort algorithm, and that has a random pivot that can sometimes randomly swap values that are the same.

    I might have fixed it once. I created a local! called old paging info. If the old paging info was the same as the paging info, I set the dataset to {}. If they were different, I ran the todataset function as normal and set the old paging info equal to the paging info. That seemed to work, i.e. I was unable to reproduce the bug, but it might have still been there hiding.
Children
No Data