Paginate, server side with ajax

Paginate, server side with ajax

eloysilvaeloysilva Posts: 2Questions: 0Answers: 0
edited July 2015 in Free community support

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);
            }
        });
    }
});

Replies

This discussion has been closed.