99
Views
2
Comments
Pagination breaks with particular column sort
Application Type
Reactive
Service Studio Version
11.53.16 (Build 61323)

Hey! I ve been doing Pagination and Sorting tutorial. Objective is to make pagination with max record selection + dynamic sort on 4 columns in the table. I did everything and while sorting by country column which is populated with only United States values, screen doesn't change while moving to next page. Every other sort seems to work fine and they share all the logic. I ve added one employee to the database (Petter Griffin Normandy Paris) and it turns out sort does it thing (Petter moves from 1st place to last) and going to the next page will remove Petter from the record shown but will be replaced with one different record and every other employee will stay the same. (While sorting by state where for example California shows up in 8 records, everything works as expected). 

I expect it to be some simple mistake from my side but i can't narrow it down especialy in light of other columns working with same client actions.


PaginationandSortingExercise.oml
2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi Konrad,

i tested your demo and see the same thing, it appears like there is some sort of shortcut in the code for performance reasons, that doesn't bother to really refresh, not sure wheter it is on the data retrieval or platform server or reactive client level.  I agree this is weird and i would call it a bug.

That being said, i don't think it is a good idea to have a sort order that doesn't make sure that on every sort there is a clear and reproducable/predictable list coming out, and the way I always do that, is to supplement any sort that my end users want, with a final sort on an attribute that I'm sure is unique, so that's often just the id, but it could be some other more meaningful attribute if you are sure it's unique.  

Turns out, if I do that to your demo app, it starts working again.  See attached oml, I added a copy screen where this extra sort is the only thing I changed.  

Dorine

PS : From a low code platform, you could expect it to do this for you, I guess. Notice also, that when no sort is specified (like when opening your screen, as you start out with no default value for Sort variable), it does use the id for a default sort, but I think that is thanks to SQL Server using it's own sort if none is given by the platform.

PaginationandSortingFixed.oml
2022-10-19 00-51-44
Viktar Ramaneika

Thank you!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.