Wappler's data views and pagination work great together!
What I'd like to do next is set the "page size" property dynamically based on the user's device. I've set a variable at the top of my page and tried using it in the page size property but no luck. I've tried various methods including
Confusingly, you need to ignore the Page Size property at the top under Data View Properties (which doesn't have a picker) and instead go to Dynamic Attributes and add it from there. It's the same for sorting and offset.
To do it directly in the code, what bpj wrote should work:
That was the clue I needed to hear @PaulS as I often still forget to check Dynamic Attributes to see if the property exists there as well. Thank you to all the other contributors for your answers as they too were all very valuable @Mozzi@bpj@ben and I look forward now to experimenting with each one.
Glad you came right
Sorry I misinterpreted your question....
I thought you wanted the "page size" value based on the users device... eg.. screen size... mobile.. laptop.... desktop..... because once you determine the "screen size" you can determine how many records you wish to display
but glad the solution above did what you wanted....
I ended up using your example code as it perfectly met my need, I just changed the offsetdatalimit variable to my pagesize variable. Since the screen size is very closely correlated with device, your code fit the requirement perfectly. It was a bonus (a cool feature) that the masonry grid would update automagically as I changed the screen size manually. There's no drawback to this implementation if a desktop user just has a smaller browser width. They can easily maximize their browser window if they prefer more videos per page.