not able to load the data to table using server side pagination
not able to load the data to table using server side pagination
i have used server side pagination for my table but the data is not being loaded, i know that start and length will be passed automatically but i need to pass the page number explicitly through the url. I have used datatables version 1.10.15. my code is as below, please help
vsChildTbl = $('#mytable')
.DataTable(
{
"language" : {
"processing" : "Please wait - LOADING SCAN Result...",
"emptyTable" : "data not found in this project"
},
"processing": true,
"paging" : true,
"sPaginationType" : "full_numbers",
"serverSide" : true,
"columns" : [
{
"defaultContent" : ""
},
{
"defaultContent" : ""
},
{
"defaultContent" : ""
},
{
"defaultContent" : ""
},
{
"defaultContent" : ""
},
{
data : null,
defaultContent : '<button type="button" class="btn-approve label label-link bg-green ">Approve</button>'
} ],
ajax : {
url : "emppage",
type : "GET",
dataType: "json",
data: function(d){
var info = $('#vschildtable').DataTable().page.info();
$('#vschildtable').DataTable().ajax.url(
"emppage?empID="
+ encodeURIComponent(empID)
+ "&projectId="
+ encodeURIComponent(projectID)
+ "&subProjectId="
+ encodeURIComponent(subProjectID)
+ "&pageNo="
+ encodeURIComponent((info.page1)+"/"+10)
);
return JSON.stringify(d);
}
},
});