Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing the number of pages #15

Open
J35P1N opened this issue Jul 2, 2015 · 2 comments
Open

Changing the number of pages #15

J35P1N opened this issue Jul 2, 2015 · 2 comments

Comments

@J35P1N
Copy link

J35P1N commented Jul 2, 2015

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.

@nespapu
Copy link

nespapu commented Aug 10, 2015

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

@seb-vial
Copy link

seb-vial commented Oct 5, 2015

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();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants