Jarek Sępek
Posts: 0
Joined: Sat Jan 26, 2013 5:58 pm

How to create pagination and "next" "prev" buttons?

Hi, I am new to tiggzi and coding in general.

All I want to do is a simple app with paginated database results (I use parse.com and REST API).

I want to have one result on a page and "prev" and "next" buttons. How to do it, step by step? Where to start? Please advise.

Thanks!

Jarek

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create pagination and "next" "prev" buttons?

The REST API needs to support pagination. It needs to provide parameters for starting point and how many records to return.

The next/prev buttons would pass parameters such as starting point and number of records to show next (or previous).

If you are new to programming in general, I highly recommend to try JavaScript and jQuery Mobile lessons at http://codecademy.com. Then, try all our Beginner tutorials: http://docs.tiggzi.com/tutorials

Jarek Sępek
Posts: 0
Joined: Sat Jan 26, 2013 5:58 pm

How to create pagination and "next" "prev" buttons?

Hi Max,
thanks for that. Could you please be more specific - what parameters do I need to provide? I created previous button and service with "skip" and "limit" with value 1. When I click the button, it returns previous item. But when I click it again, nothing happens. So I am not sure how to set the starting point you've mentioned.
Please help. Thanks!

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create pagination and "next" "prev" buttons?

The parameters - depend on the service you are using. What's the service you are using?

Jarek Sępek
Posts: 0
Joined: Sat Jan 26, 2013 5:58 pm

How to create pagination and "next" "prev" buttons?

Hi, I am using Parse.com

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create pagination and "next" "prev" buttons?

What have you tried..? Do you have the curl commands from Parse to get the next/prev records?

Jarek Sępek
Posts: 0
Joined: Sat Jan 26, 2013 5:58 pm

How to create pagination and "next" "prev" buttons?

Their docs mention only "limit" and "skip" to do pagination. Unfortunatelly they dont mention how to do next/prev button. I looked everywhere for a simple tutorial but couldnt find anything.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

How to create pagination and "next" "prev" buttons?

Those are the two parameters you need to create pagination.

limit - is how many to display
skip - how many to skip (at which record to start).

For example, if you have 100 records.
limit = 10
skip = 0

will display the first 10.

limit = 10
skip = 10

will display the 11-20

You would need to update limit/skip in the URL during run time.

I'll post an example later this week of how to do it in Tiggzi.

Jarek Sępek
Posts: 0
Joined: Sat Jan 26, 2013 5:58 pm

How to create pagination and "next" "prev" buttons?

I just dont know how to update limit and skip everytime I click prev/next buttons. I will be waiting for your post.
Thank you very much Max!
Regards
Jarek

Jahmarley
Posts: 0
Joined: Mon Apr 16, 2012 8:21 pm

How to create pagination and "next" "prev" buttons?

looking forward to this tutorial.

Return to “Issues”