I’m struggling a bit to apply paging to a repeat region. Any help will be appreciated.
I followed this guide (https://docs.wappler.io/t/nested-repeat-regions) and followed the steps to the point. As per this guide, on the server side, query1 fetches parent records and query2 (within a repeat loop) fetches child records.
Now, as per the other guide https://docs.wappler.io/t/applying-dynamic-paging, paging can be achieved by using a paged query, so I converted above “query1” (parent record) into a paged query and got the offset variable set as well.
Now, as you can see in the above screenshot, the parent-child combination is on repeat1, so when I bind with repeat1 query on the front-end, i lose the ability to query the next pages by adding the bootstrap pagination component (connecting it to repeat1 - the same data source). See below picture from the guide https://docs.wappler.io/t/applying-dynamic-paging where the bootstrap pagination component is connected to a query that has paging capability.
@Teodor, I got a notification of a reply from you, but can’t see it here. Probably you deleted it after reading through my post above and see what the trouble is… which is,
repeat on server side loses pagination (and other properties like sort, direction, offset & limit), and when bound to any client-side components, can’t do pagination, filter & sort.
Looking forward to hear from you on a possible solution alternative. Thanks in advance!
Dave, did you get to achieve paging. I’m struggling with the same. Any tips/tricks, where you able to achieve sort, filter as well on your nested table? Unfortunately, paging is a must in my requirement, unable to proceed any further.
Hi @Akayy
Yes, i deleted my comment as i missed a part of your explanation on my phone
So, the problem here is that with the repeat you are repeating the [data] part, which returns your query results only. The paging part is not accessible when you repeat the [data].
How big is your database, how many records does it contain? You can create the paging and filtering on the front end, using the data view component, if the are no too many records actually returned.
The other thing is to make what’s needed with a database view and use the paged query, without any repeaters.