Reputation: 9713
I'm currently using jQuery Datatable. I also use jquery ui to provide good theme. However, I want to disable (hide) the first
and last
button of the pagination from the table by using a bit customization on jquery library.
The problem is that the customization has only 2 methods: full_numbers
and two_button
.
So how can I get the pagination without the first
and last button
?
Any help would be very much appreciated.
Thanks
Upvotes: 4
Views: 15368
Reputation: 641
You have 4 options:
simple
- 'Previous' and 'Next' buttons onlysimple_numbers
- 'Previous' and 'Next' buttons, plus page numbersfull
- 'First', 'Previous', 'Next' and 'Last' buttonsfull_numbers
- 'First', 'Previous', 'Next' and 'Last' buttons, plus page numbersSo in your case :
$("#youridtable").dataTable(
{
"pagingType": "simple_numbers"
});
src: http://www.datatables.net/examples/basic_init/alt_pagination.html
Upvotes: 16
Reputation: 975
We do not need to use CSS. Just hack into sFirst and sLast options of Datatable:
$(document).ready( function() {
$('#example').dataTable( {
"oLanguage": {
"oPaginate": {
"sFirst": "",
"sLast": ""
}
}
});
});
Reference: http://legacy.datatables.net/usage/i18n
Upvotes: 1
Reputation: 165
You can always use css
.dataTables_paginate .last{display:none;}
Upvotes: 1
Reputation: 1876
Write your own javascript to hide/remove the elements.
$(".first.paginate_button, .last.paginate_button").hide();
Upvotes: 4