wikiti / jquery-paginate

A simple pagination plugin for html tables.
MIT License
14 stars 16 forks source link

ellipsis page numbers #3

Open joelbrennan0 opened 6 years ago

joelbrennan0 commented 6 years ago

Hi.

I have a set of results paginated to over 100 pages. Is there any way to format the navigation to say something like:

<< < 1 2 3 ... 98 99 100 > >>

Apologies if this is in the documentation, I couldn't seem to find it.

Thanks

For the time being I'm just doing this: pageCount = $('.page-navigation a').length; if (pageCount > 20) { $('.page-navigation a').hide(); $('.page-navigation a').slice(0, 5).show(); $('.page-navigation a').eq(5).after('...'); $('.page-navigation a').slice(pageCount - 5, pageCount).show();

    $('.page-navigation a').click(function () {
        $('.page-navigation a').hide();
        $('.page-navigation a').slice(0, 2).show();
        $('.page-navigation a').slice(pageCount - 2, pageCount).show();
        $('.page-navigation a[data-selected="true"]').prev().show();
        $('.page-navigation a[data-selected="true"]').show();
        $('.page-navigation a[data-selected="true"]').next().show();
    });
}`
Dolu- commented 6 years ago

Hello, You could take a look at this comment : https://github.com/wikiti/jquery-paginate/issues/1#issuecomment-363485053 I think it will answer your question.

wikiti commented 6 years ago

@joelbrennan0 Hey!

I though that GitHub would automatically notify me on my own repositories; looks like I was wrong. As stated by #1, that hack may solve your issue.

However, after 2 issues, I will consider adding a new feature to this library.

Best regards, Daniel