rstaib / jquery-bootgrid

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

Pagination (only 3 pages max) #334

Open laurentb0204 opened 7 years ago

laurentb0204 commented 7 years ago

Hi,

I want to display only 3 pages maximum in the pagination of a JqueryBootGrid grid. I tried several methods like (templates: {pagination: ???}) but it does not work ... Can you tell me if this is possible and how I can do, thank you in advance.

Laurent BROUCK

bellwood commented 6 years ago

As the job of the grid is to paginate all data given to it, it would be on you to limit the amount of data given to the grid.

jaandric commented 6 years ago

As I can see in code, pagination size is determined like this: maxCount = this.options.padding * 2 + 1, where this.options.padding is by default 2. So 2 * 2 + 1 = 5...so pagination will have 5 pages by default...if you want 3 you need to change padding settings to 1:

$('#grid-history').bootgrid({
    'padding': 1
});

Resulting in this: screenshot_1