Chankey Pathak
Chankey Pathak

Reputation: 21676

jQuery datatables: manipulating full_numbers

Using

"sPaginationType": "full_numbers"

Shows

First,Prev, 1,2,3,4,5, Next, Last

I don't want to show 5 pages, I want to show only 3 like

First, Prev, 1, 2, 3, Next, Last

And then if user is on 3rd page then show

First, Prev, 3, 4, 5, Next, Last

How can this be done? I'm sure there should be an option in dataTables for that, I was unable to find it.

Upvotes: 0

Views: 1508

Answers (1)

Suchit kumar
Suchit kumar

Reputation: 11869

the only fix you can do by modifying the BootStrap Pagination plugin, found here https://datatables.net/plug-ins/pagination add this:

jQuery.fn.dataTableExt.oPagination.iFullNumbersShowPage=3; 

more details here:http://datatables.net/forums/discussion/20541/limit-number-of-page-tabs-with-bootstrap-pagination

or do this:

$.fn.dataTableExt.oPagination.iFullNumbersShowPages = 3; 
$('#my-table').dataTable({ //your options });

Upvotes: 1

Related Questions