superRaytin / paginationjs

A jQuery plugin to provide simple yet fully customisable pagination.
http://pagination.js.org
MIT License
912 stars 659 forks source link

pageSize not working when getting Google fonts #54

Closed aschente closed 6 years ago

aschente commented 6 years ago

I tried to get the google fonts and its working fine except for the page size . Its show all the data instead show every 20 data per paginate.

This is my sample code.

$('#fonts-pagination-container').pagination({ dataSource: 'https://www.googleapis.com/webfonts/v1/webfonts?key=' + google_api_key, locator : 'items', totalNumberLocator: function(response) { // console.log(response.items); // you can return totalNumber by analyzing response content return response.items.length; }, pageSize: 20, className: 'inktoink-pagination', classPrefix: 'inktoink-paginate', ulClassName: 'pagination', callback: function(data, pagination) { var html = paginateTemplate(data); $('#fonts-container').html(html); } });

Btw the plugin is very amazing, keep up the good work.

aschente commented 6 years ago

Its working now, I didn't read the document thorough.