i'm using datatables and for pagination i've used paggingtype = "input" and also included its plugin cdn but unfortunately when i used this, it is automatically disabling the First Next Previous and Last pagination buttons and i needed them enabled so that i can use them alongwith input text field.. Any help will be a huge favor
Here's my JavaScript:
$(document).ready(function () {
$('#categories').DataTable({
"processing" : true,
"pagingType" : "input",
"ajax" : {
"url" : ajaxurl + "/ManageCategories/fetchCategories",
"type" : "POST"
}
});
});
and here's my DataTable showing output:
thanks, Ameer
I got a solution to my question i.e. whenever "paggingType" is used it will overwrite the default "paggingType" so in order to get a text input i can add it manually by inserting this javaScript:
$("div.toolbar").html('<div><input type="text" id="pageJump" placeholder="page">
<button id="jump" type="button">Go</button></div>');
$('#jump').click( function() {
table.page(parseInt($('#pageJump').val())-1).draw(false);
})
try simple_numbers
and check
"pagingType": "simple_numbers"
simple_numbers: function ( page, pages ) {
return [ 'previous', _numbers(page, pages), 'next' ];
},
simple_numbers
- 'Previous' and 'Next' buttons, plus page numbers