KnpLabs/knp-components — Issue #13: Resetting page to 1 when number of results for given page is 0
Author: loostro
Created: 2012-03-07 13:52:27+00:00
State: open

Example of use:

I have a CreateUser form and a paginated list of "find All Roles Except Roles Owned by User".

Lets say I have total 11 roles. Paginator limit is set to 10. So I have 2 pages. (page 1 with 1-10 and page 2 with 11).

Now, I add 2 roles to User with JAVASCRIPT (remove table row from Roles List, add new form item to user).

Next, I click on "go to page 2" link. It triggers an AJAX call (that should return new list).

The AJAX call also submits the form (so, my controller is aware of the roles i added).

So, now my "find All Roles Except Roles Owned by User" is 9 items long (becouse I added 2 roles to user). Page 2 does not exist (its empty).

Ofcourse, I could write this into my code, but i believe it should be inside the core paginator code (in the paginate function).