0

I am using the pagination plugin found on: http://flaviusmatis.github.io/simplePagination.js/

This is the code I am using in my programme:

$(function() {
  $('#pager').pagination({
      items:data.length,
      itemsOnPage: 10,
      cssStyle: 'light-theme'
  });
});

The problem is that I want my 'data' object to be paginated. I am initializing an empty table and filling it after appropriately manipulating the html by:

$('#tabbody').html(upd);

Just below this tabbody is the pager placeholder. How do I tell the plugin what data to break into pages? Is there any other plugin that makes this easier?

Lokesh Yadav
  • 1,574
  • 5
  • 23
  • 50
  • Is there any server side involved?? – ozil Jun 19 '15 at 06:53
  • possible duplicate of [How to use pagination on HTML tables?](http://stackoverflow.com/questions/19605078/how-to-use-pagination-on-html-tables) – ozil Jun 19 '15 at 06:56
  • This project is based on Django. On clicking search, a Django view is called which returns the data to jquery. The jquery then ogranizes the data in proper html to send to tabbody. upd is just the data with the proper tags to be inserted into the table. – randomnessrandomly Jun 19 '15 at 06:59
  • Let me try if i can get close to understand the issue, As per documentaiton provided for this plugin, it just creates the pagination nodes for you based on total items & page sets provided. You need to write the code logic to display/fetch the data to be shown. Make use of options/method in plugin like onPageClick(pageNumber, event). – Lokesh Yadav Jun 19 '15 at 08:02
  • if it is possible then please provide the "upd" i.e the html you want to be paginated. That would help us to think of possible way to put data on page – Lokesh Yadav Jun 19 '15 at 08:04

0 Answers0