Help with ListShifter Pro Sort when using Pagination

Hi @keith

I am using ListShifter Pro to display a list of assets. I have pagination enabled (for example, showing 10 items per page). I am attempting to sort my list, but for some reason the sort only sorts the items of the current page. (I.e. if I am showing 10 items, only those 10 items will be sorted, not the entire list). Am I doing something wrong?

I would expect to sort through all items of Listshifter and not just the current page. I am probably doing something wrong, but I cannot figure out what that is.

Thank you
Andy

I wasn’t even aware that there was a ListShifter PRO.

I use the plain old ListShifter, but I don’t use the pagination. But I do let the user change the sort of the list.

Screenshot 2023-11-06 at 10.06.26 AM

Did you see what the results would be if you used “Original List” rather than “Shifted List”. Again, I don’t use PRO and I don’t use the pagination, but this is the first thing that I could come up with (which may be completely unhelpful).

Thank you. Using the “sorted” function does not actually seem to work in the workflow. The only way I have even gotten it sort is by using the “type of sort by list” as text. When changing it to the database type, and then “sorted by” does not work. Nothing ever sorts.

I definitely think it has to do with the pagination as it works fine sorting all the items on the current page. I guess what I need to figure out is how to sort all the items, but I don’t know if that’s maybe a bug in the listshifter or if I missing a step.

Are you using the ListShifter’s Shifted List as your RG’s data source?

Mine works with no issues (with pagination)

That’s correct. The source is using ListShifterPro’s shifted list. I’ve replicated this on a test page for testing simplification. I’ve added a simple ListShifterPro like this

The repeating group uses the shifted list as data source

SCR-20231106-gbk

I then added a button to call the sort workflow. The workflow consists of a single action “SORT List ListShifterPRO”

There are about 100 items in the database, but pagination is only showing 10 at a time. When sorting only the 10 are currently sorted. Not sure what I am doing wrong…

In the “sort by list” parameter have you tried using the Original List instead of Shifted list.

Yes, tried pretty much any way I could think of.

Hmm… I’ll check my setup for these when i have the time. In the meantime does ListShifter’s lists in the Bubble debugger show the right number of items and in the sorted order?

I just checked my setup and it looks like I was wrong. I was not using LS pagination mode for one of them, just the normal RG pagination.

The other that does use it does limit the number of items in it’s Original and Shifted Lists to the number of items per pagination. I’ve verified this in the debugger. After some thinking I remember experiencing a similar issue with extracting the list from ListShifter PRO in pagination mode. I worked around it but it was a little annoying.

What you can do is to use native RG pagination. Alternatively, you could store the master list in one List Shifter which will handle the sorting and then another List Shifter to handle the pagination. There’s no performance impact from daisy chaining in my experience.

Maybe if we all rub our hands together long enough, we might be able to summon @keith back from his sabbatical from Bubble.

Thank you for looking into this . I hope Keith can shed some light on this. I don’t believe I can go to using the repeating group (I am actually using the new Bubble Table) since I allow the user to set how many items they want to view. Otherwise I’d have to set a fixed number of items per page, which I don’t want to do.

@andreas2 were you able to find a solution for this? @Keith I have a similar issue here and the pagination doesn’t work on a sorted list for me.

I know it’s hard to find stuff in the forums sometimes, but this is a frequently asked question. The answer is to sort your list in one List Shifter (so you can sort the entire list properly) and then feed the Shifted List of that List Shifter into a second one where you paginate.

Note that this defeats some of the advantages of pagination (as you’re loading the entire list in order to sort it), but that’s how you handle this case.

A List Shifter in pagination mode only “knows” about the items on the currently displayed page.

2 Likes

Thanks Keith! I will do a more thorough search next time :wink: