Page count with Repeating Groups

Hi All,

Thanks for all your posts and build with bubble site which have saved me hours and headaches! But couldn’t find solution to my problem below.

Here is my situation… I’m having a fixed number of cells repeating group - with 10 rows and have 11 records.

However, when I click on the next icon, rather than go to the next page and show only 1 record as I would expect, it’s showing 10 rows. It seems to be bumping up the entire RG rather than go to the next page. In other words, the record that was previously 1 disappears, and the record that was 2 is now 1. Maybe this is the expected behavior…

That being said, is it possible to show the next page of records rather than just increment the records by 1? So that if I have 11 records, page 1 shows 10 records, then click on the next icon, it goes to page 2 and shows the 11th record on its own.

Hi there I got the same problem before
Take a look at the topic linked below.

You have to use custom states to calculate the RG record number to start on of each pagination page and the number of records to should on each pagination page. Than you can filter the list show items from start until end of each page.

Hi @FJP,

Thanks for the quick response.
I have gone through the link which you have pasted above.
But I didn’t understand the where to use custom state function.
If possible can you share you editor access or some images of that…

I will try give a more detailed explanation in the evening today

I have the repeating group in a Reusable element. But that can also be the page or group the RG is located.

Custom States

  • first_page
  • current_page
  • last_page
  • current_page_start
  • page_size

Pagination - List of Numbers (plugin)

  • Length of list
    image

Workflow - Pageload

Workflow - Previous (click)

  • Set state current_page to current_page - 1
  • Trigger Custom Event: Calculate current page start

Workflow - Next (click)

  • Set state current_page to: current_page + 1
  • Trigger Custom Event: Calculate current page start

Workflow - Pagenumber (click)

  • Set state current_page to: current_page = current cell page number
  • Trigger Custom Event: Calculate current page start

Data source Repeating group:

8 Likes

Hi, @wsu.app18

I updated my previous reply on this topic. Please take a look above.

Good luck!

Thank @FJP, it works very well for me.

1 Like

can someone share the editor link of his/her app that used this method please as I didn’t understand some things mentioned in the solution?

can you share the editor link or some screenshots so it may be more clear to me?

I’m sorry @FJP,
it is not clear to me the Trigger Custom Event “calculate current page start”.
How and when is it used?
Do you have this example in an editor, or could you take a screenshot of the workflow, please?
Thanks

Hi, I will try to share some more details this weekend

Hi @FJP I’m also lost with this event trigger as well Custom stuff. Any updates for the editor ?

@eraldolattari and @partners
The calculate current page start is triggered on any event, so this means on:

  • Page load
  • click next
  • click prev
  • click on a specific page number

What it does is to determine from what record the data list should be shown.

For example having each page containing 5 records of the entire dataset.

On page 1 you want the list to start with the record 1 to 5.
So current page start = (1-1)*5+1 = 1
On page 2 you want to show only record 6-10
So current page start = (2-1)*5+1 = 6
And so on…

Is this more clear now?

Thanks @FJP it’s more clearer now.

However, I do have an issue with a fix no of columns in relation to this - How to handle this fix number of cells in Repeating Group for paging

Any ideas to fix this?

Sorry for very late reply. Do you mean fixed number of columns on the page number list?

If so I try something out when I am able to. I am thinking to determine the start of thr number kist bybusing a custom state