Paginate, server side with ajax
Paginate, server side with ajax
eloysilva
Posts: 2Questions: 0Answers: 0
I try all the examples, someone can show data paged from the server
this is my code, and it does not work, but the data shows pagination does not work properly
$("#table").dataTable({
"bServerSide":true,
"bProcessing": true,
"fnServerData": function(sSource, aoData, fnCallback, osettings){
var info = $("#table").DataTable().page.info();
$.ajax({
dataType: 'json',
type:'get',
url: "api/method"+ info.page + 1,
data: aoData,
success : function(data){
fnCallback(data);
}
});
}
});
This discussion has been closed.
Replies
Does your
api/method...
fully support the required server-side processing protocol? If not, that is the issue.Worth noting that fnServerData is legacy. I would suggest using the
ajax
option.Allan