rstaib / jquery-bootgrid

Nice, sleek and intuitive. A grid control especially designed for bootstrap.
http://www.jquery-bootgrid.com
MIT License
973 stars 364 forks source link

Wrong page calculation for linkes "next" and "prev" pages #417

Closed mvcmaker closed 5 years ago

mvcmaker commented 5 years ago

Hi, this plugin has a bug when going to "prev" or "next" page. The sent item to the backend when you click this links sends a bad "current" value, it sends the current value multiplied by rows per page, and that's wrong. Does anybody know hot to fix this?

mvcmaker commented 5 years ago

Solved! There's a bug on source code, on fie jquery.bootgrid, the next code in the renderPaginationItem() function:

 var commandList = {
                            first: 1,
                            prev: that.current - 1,
                            next: that.current + 1,
                            last: that.totalPages
                        };

must be replaced by

 var commandList = {
                            first: 1,
                            prev: that.current - 1,
                            next: parseInt(that.current) + 1,
                            last: parseInt(that.totalPages)
                        };