Server Side Processing
Server Side Processing
[quote]
I have passing argument to the server page. and get json Details from server. Here data didn't come to dataTable. In server i get the passed argument like this
[/quote]
[code]
$imei = trim($_GET['imei']);
[/code]
[code]
function DataTable(imei_app) {
var DataTableApp = $('#DataTableApp').dataTable({
"sAjaxSource": "php/getAppDetails.php",
"bServerSide": true,
"bRetrieve":true,
"bDestroy":true,
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name" : "imei", "value":imei_app } );
$.getJSON( sSource, aoData, function (json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json);
console.log(json);
});
},
"aoColumns": [{
"mData": "appName",
}, {
"mData": "appId",
}, {
"mData": "versionInstalled"
}, {
"mData": "appSize",
}, {
"mData":"dataSize",
},{
"mData": "appType",
},{
"mData":"installedLocation",
},{
"mData": "appType",
}],
});
}
[/code]
I have passing argument to the server page. and get json Details from server. Here data didn't come to dataTable. In server i get the passed argument like this
[/quote]
[code]
$imei = trim($_GET['imei']);
[/code]
[code]
function DataTable(imei_app) {
var DataTableApp = $('#DataTableApp').dataTable({
"sAjaxSource": "php/getAppDetails.php",
"bServerSide": true,
"bRetrieve":true,
"bDestroy":true,
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name" : "imei", "value":imei_app } );
$.getJSON( sSource, aoData, function (json) {
/* Do whatever additional processing you want on the callback, then tell DataTables */
fnCallback(json);
console.log(json);
});
},
"aoColumns": [{
"mData": "appName",
}, {
"mData": "appId",
}, {
"mData": "versionInstalled"
}, {
"mData": "appSize",
}, {
"mData":"dataSize",
},{
"mData": "appType",
},{
"mData":"installedLocation",
},{
"mData": "appType",
}],
});
}
[/code]
This discussion has been closed.
Replies
Allan
I am using this. but there is no response from server. and Table shows data is empty
[/quote]
[code]
var DataTableApp = $('#DataTableApp').dataTable({
"sAjaxSource": "php/getAppDetails.php",
"bRetrieve":true,
"bDestroy":true,
"fnServerParams": function ( aoData ) {
var imei_apps = document.getElementById('imei').value;
aoData.push( { "name": "imei", "value": imei_apps } );
},
"aoColumns": [{
"mData": "appName",
}, {
"mData": "appId",
}, {
"mData": "versionInstalled"
}, {
"mData": "appSize",
}, {
"mData":"dataSize",
},{
"mData": "appType",
},{
"mData":"installedLocation",
},{
"mData": "appType",
}],
});
[/code]