Skip to content
New issue

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

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

Already on GitHub? # to your account

Possibility to link multiple paginators #15

Open
HerrLiljegren opened this issue Dec 18, 2013 · 2 comments
Open

Possibility to link multiple paginators #15

HerrLiljegren opened this issue Dec 18, 2013 · 2 comments

Comments

@HerrLiljegren
Copy link

Is it possible to link multiple paginators so that if you change page in one of them, the others change too?

Most useful in a scenario where you have a paginator at the top and bottom of a long list of items.

@HerrLiljegren
Copy link
Author

I found out a solution to this by hooking up the onPageClicked-callback

onPageClicked: function (event, originalEvent, type, page) {
    // Select my two navigation UL:s, and subset the currently clicked UL so I end up with the second navigator
    var $otherNav = $("#navigation-top, #navigation-bot").not(event.currentTarget);

    // Call bootstrap-paginators "show"-method to switch the page on the second paginator
    $otherNav.bootstrapPaginator("show", page);
},

@africanrhino
Copy link

a solution that does not trigger the onPageclick event of the other paginator like calling "show" does..
$otherNav.bootstrapPaginator( { currentPage: page });

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

No branches or pull requests

2 participants