Data table pagination not showing
Data table pagination not showing
madusanka
Posts: 20Questions: 7Answers: 0
how to apply pagination option in this code? I have attached a screenshot of current page
self.dataTable = $("#booking_list").DataTable({
serverSide: true,
paging: true,
info: true,
ajax: {
data: {
"token": localStorage.getItem("token"),
},
url: 'api/v1/bookings',
dataFilter: function (data) {
var json = jQuery.parseJSON( data );
var resellerreponce = json.data.searchResults;
self.bookings = resellerreponce.bookings;
json.data = resellerreponce.bookings;
json.recordsFiltered = resellerreponce.recordsFiltered;
json.recordsTotal = resellerreponce.recordsTotal;
console.log(json);
return JSON.stringify( json );
}
},
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
this is the json
Your
recordsFiltered: 10
is saying there are only 10 records total, so one a 10 record page, there wouldn't be paging. The protocol is discussed here, and a live examples here.Cheers,
Colin
Thank you very much @colin .