Ajax - Server-side processing with pagination
Ajax - Server-side processing with pagination
Hi.
I tried create table with pagination with Ajax - Server-side processing
** I get json data :-
{"recordsTotal":56,"recordsFiltered":4,
"table_data":[{"stud_id":"1","stud_name":"ABC","class":"1"},{"stud_id":"5","stud_name":"PQR","class":"2"},{"stud_id":"6","stud_name":"LMN","class":"3"},{"stud_id":"10","stud_name":"XYZ","class":"1"}] }
** but at the html side it shows
Showing 1 to 4 of 4 entries (filtered from 56 total entries) and data row as "No Matching Records Found"
** My datatable code as :
$('#datatable_info').DataTable({dom: "Bfrtip",
"processing": true,
"serverSide": true,
"ajax": {
url,
"dataSrc": ""
},
buttons: [{extend: "copy", className: "btn-sm"}, {extend: "csv", className: "btn-sm"},
{extend: "excel", className: "btn-sm"}, {extend: "pdf", className: "btn-sm"},
{extend: "print", className: "btn-sm"}], responsive: !0,
"order": [[0, 'desc']],
"aoColumns": [
{'mData': "table_data.stud_id"},
{'mData': "table_data.stud_name"},
{'mData': "table_data.class"}
],
});
*** I need help for creating table which
1: load data with AJAX Server-side processing
2: pagination which load 10 records at start & load next / previous 10 records on button click previous 1 2 3 .. 10 last
Thank You.
Answers
I do it so.
`
lengthMenu: [[10, 25, 0], [10, 25, "Alle"]],
serverSide: true,
processing: true,
searching: false,
`