flask-paginate icon indicating copy to clipboard operation
flask-paginate copied to clipboard

Page number not updating when chaning page_parameter

Open poltorres0999 opened this issue 4 years ago • 7 comments

Hi, I'm experimenting an issue when chaning the default page_parameter to have two pagination objects, since the page number is not chaging when selecting any of the pages of any of the two tables, the data is changing correctly and the query string is also updating it's values correctly.

Thank you,

Pol

poltorres0999 avatar Dec 04 '19 02:12 poltorres0999

Sorry, I'm not quite sure what do you mean. Could you paste some codes for example?

lixxu avatar Dec 06 '19 00:12 lixxu

at the moment I used two paginations on same page but after I added customizable page_parameter, page update number, doesn't work; image

machines94 avatar Jan 07 '20 13:01 machines94

two paginations? you mean two Pagination instances?

lixxu avatar Mar 28 '20 08:03 lixxu

Hello @poltorres0999 I also had the same issue. I found this bug in the code and I fixed it. I also found one other bug which I also fixed. Here is PR https://github.com/lixxu/flask-paginate/pull/85 @lixxu here's description Lets say we have an app.py image

So we want to specify a custom page and per page parameters ('p' and 'pp'). Frontend is image

Expected behaviour is that we get page looking like this image

which we get!

But the problem is when you click '2' or '3' or any other number in the pagination.info generated area this happens. image As you can see page refreshed, showed new results but pagination.info didn't change. So I fixed that and I also found a new bug. In the same example when you want to have different 'per_page' items (in this case 'pp') it works partly and it breaks pagination image

Can you spot the problem? The number of pagination pages in the pagination.info didn't change. That means if we go to the last page, we will get no results image I fixed that issue also in the PR

kelj0 avatar Sep 24 '20 07:09 kelj0

version 0.7.1 fixed the issue. Your PR can not fix it if page_parameter and per_page_parameter set.

lixxu avatar Sep 25 '20 07:09 lixxu

The issue is still relevant in version 0.7.1. Have two tables and two Pagination objects, when change the page_parameter param for one. Pagination links don't show right page for a Pagination object which doesn't have default page param.

aleksandar avatar Sep 27 '20 20:09 aleksandar

hey @aleksandar try to use my fix here https://github.com/lixxu/flask-paginate/pull/85/commits 😃 Lixxus fix doesn't work for me also.

kelj0 avatar Oct 15 '20 14:10 kelj0