0

I tried to search and get this link Making jQuery Pagination , but in this tutorial is for the static content. But for me, I use JSON to retrieve data that my controller query. Then I take the result of the JSON, list in the table, div and span. In my table there are many rows, so I want to do it as pagination.

Could anyone show me some clues about this issues? Thanks in advanced.

1 Answer 1

1
  1. First time load, send specified number of records from your server, display on client.
  2. On click of next, send the page number that you are in and number of records needed, server should send json with data for next page.
  3. Do the same thing for previous.

All of these request will be ajax call.

For displaying you can choose multiple option:

  1. Have one div for every say given records like 10, 20 and then on prev next you can move also give them id as page number so that you can easily identify the page you are in.

  2. Add new rows in your table this would require more effort IMHO.

Don't hit database for every next, prev database resources are limited, instead fetch extra rows (depending on the use case) and keep it in memory.

Sign up to request clarification or add additional context in comments.

1 Comment

Excuse me, could you give me some of reference code about that? Thanks.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.