botmonster / jquery-bootpag

BootPag - boostrap dynamic pagination jQuery plugin
MIT License
525 stars 263 forks source link

'next' and 'prev' skip a page when using href-option #19

Closed gvanderploeg closed 9 years ago

gvanderploeg commented 10 years ago

When clicking the next- or prev-button combined with the use of the custom href-option, the {{number}} in the href will skip a page. When beginning on page 1, clicking on 'next' will have these effects:

Same goes for the 'prev' button.

Example with debug logging in JS Fiddle: http://jsfiddle.net/SuUZ6/

catsncode commented 10 years ago

I am stuck on this issue as well. Does anyone have a work around or a fix? Thanks!

gvanderploeg commented 10 years ago

We worked around it by using the 'page' event instead of the href-option. In the page-event we just set window.location using the 'num' parameter (which is correct there and does not skip a page)

catsncode commented 10 years ago

Thanks for the tip! I did find how to fix the javascript, but I'm not sure if it might break something else. So far it is working well.

me.find('li').click(function paginationClick(){ var me = $(this); if(me.hasClass('disabled')){ return; } var page = parseInt(me.attr('data-lp'), 10); /////renderPage($bootpag, page); /* was causing the skip */ $owner.trigger('page', page); });

botmonster commented 9 years ago

should work fine since 1.0.6

concreto commented 8 years ago

...still had this issue with 1.0.7. Thanks to @gvanderploeg, your idea helped us a lot!

signalw commented 7 years ago

I'm also having the same issue, with 1.0.7...

Namstel commented 6 years ago

I'm also having this issue with 1.0.7. Thanks for the suggestion @gvanderploeg.

mariummalik22 commented 5 years ago

I am also facing the same issue on 1.0.7

chaitu234kin commented 5 years ago

Hi @gvanderploeg , Can you please let me know the fix you did for the above issue

gvanderploeg commented 5 years ago

@chaitu234kin , it's more than 5 years ago... I don't know by heart anymore. But according to my comment above, that workaround did it for me.