from the data, I load 5 objects by default using “Load Table Objects”. I added the “Load more” button and I would like it to show me another 5 objects each time I click on it. How to do it? I can’t find any instructions anywhere.
Thank you in advance for your help
Can anyone help me? I want to add any pagination of objects from the database that I load to the front end using UI Builder… please help
There are two parameters:
The first one (
page size) controls how many objects are to be returned by the server. In your case, you mentioned it is 5.
The second one (
page offset) is the index of the object in the database to return. The very first object in the database has index 0. When you need to get additional 5 objects, you need to set the index to 5. For more information about paging, visit the following page in the docs:
Welcome to our community and thanks for trying Backendless!
The following logic can be used as an option to what Mark mentioned earlier:
On page Enter add the next logic:
On Click event handler of the “Load more” button, should have the next logic:
What do you think if I load all records upfront and then do the pagination on the page without loading any data from the server?
Hi @Jorg_Beyer ,
It is also an option. But you should consider possible drawbacks of this solution:
- When your table is big, you will be unable to load all records via one request since max page size in Cloud version of Backendless is 100 items per page.
- Loading of more objects than page contains can take more time.
- When you preload data, your page will miss all the new records which were added to the table after last data preload. The same applies for removed records.
If you understand moments described above and think that in your case they will not create any trouble then you can use your approach.