John Stockinger
Posts: 0
Joined: Thu Aug 07, 2014 4:41 am

Pagination and Dynamic total variable

Hello,

I used this tutorial to add pagination to my app

http://devcenter.appery.io/tutorials/...

It worked great, but I'd like to be able to set the 'total' variable dynamically based on the number of records in my database.

localStorage.setItem('total', 3); <-- I want the 3 to be dynamic

Do you have any direction on how to set that number to be dynamic?

Thank you,
John

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Pagination and Dynamic total variable

Hello!

As mentioned in tutorial "run a service to count how many objects there are". Here is more information http://devcenter.appery.io/documentat...

John Stockinger
Posts: 0
Joined: Thu Aug 07, 2014 4:41 am

Pagination and Dynamic total variable

That gave me what I needed! Thank you :)

For anyone who has the same problem, this is the JS i ended up with

localStorage.setItem('total', parseInt(localStorage.getItem('count')));

count was a local variable set with a query_service service that was invoked when my page loaded.

I had to add a parameter name to the Request portion of the service, which I also called count :)

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

Pagination and Dynamic total variable

John,

Thank you for sharing solution.

Return to “Issues”