list.pagination.js icon indicating copy to clipboard operation
list.pagination.js copied to clipboard

Changing the number of pages

Open J35P1N opened this issue 9 years ago • 2 comments

Hi,

I am trying to allow my end user to select the number of results shown per page. How would I do this?

At the moment I have this code:

var numberOfItems = 3; var options = { valueNames: ['name', 'type', 'difficulty'], page: numberOfItems, plugins: [ ListPagination({}) ] }; var userList = new List('search', options);

$('.changePages').on("click",function(){ numberOfItems = 2; userList.update(); }

This should update the pagination as far as I am aware but nothing happens when I click my button with the changePages class.

J35P1N avatar Jul 02 '15 11:07 J35P1N

Same problem here. Did you find a solution? I need to refresh the page so the new configuration takes effect.

nespapu avatar Aug 10 '15 08:08 nespapu

Try this:

var numberOfItems = 3; var options = { valueNames: ['name', 'type', 'difficulty'], page: numberOfItems, plugins: [ ListPagination({}) ] }; var userList = new List('search', options);

$('.changePages').on("click",function(){ userList.page = 2; userList.update(); }

seb-vial avatar Oct 05 '15 13:10 seb-vial