aoColumnDefs,aoColumns,json,serverside
aoColumnDefs,aoColumns,json,serverside
maxan
Posts: 3Questions: 0Answers: 0
i have following json from server side through ajax call
[code]{"aoColumns":[{"mDataProp":"deptName","sTitle":"Department Name"},{"mDataProp":"deptId","sTitle":"Department Id"}],"aoColumnsRef":[{"aTarget":["2"]},{"aTarget":["1"]}]}[/code]
[code]
$.ajax({
type: "POST",
url: "./viewController",
data:{ "TableName" : "ViewGridDept",
"Call" : "gridConfiguration"},
dataType:"json",
success: function(data){
//columns=data.aoColumns;
var coldata = eval( '('+data+')' );
alert(coldata.aoColumns);
employeeTable = $("#EmployeeTable").dataTable({
bJQueryUI : true,
"sPaginationType" : "full_numbers",
"bFilter": true,
"bInfo": true,
"bServerSide": true,
"sAjaxSource" : "./viewController",
"aoColumns":coldata.aoColumns ,
"aoColumnDefs":coldata.aoColumnsRef,
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name" : "TableName", "value" : "ViewGridDept" },
{ "name" : "Call", "value" : "Data" } );
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );}
[/code]
but my json can not loaded into datatables .kindly help me .
i know this topic is almost same as below link but i do same solution but not get any success.
http://datatables.net/forums/discussion/3442/aocolumndefs-fnrender-.getjson-combo/p1
[code]{"aoColumns":[{"mDataProp":"deptName","sTitle":"Department Name"},{"mDataProp":"deptId","sTitle":"Department Id"}],"aoColumnsRef":[{"aTarget":["2"]},{"aTarget":["1"]}]}[/code]
[code]
$.ajax({
type: "POST",
url: "./viewController",
data:{ "TableName" : "ViewGridDept",
"Call" : "gridConfiguration"},
dataType:"json",
success: function(data){
//columns=data.aoColumns;
var coldata = eval( '('+data+')' );
alert(coldata.aoColumns);
employeeTable = $("#EmployeeTable").dataTable({
bJQueryUI : true,
"sPaginationType" : "full_numbers",
"bFilter": true,
"bInfo": true,
"bServerSide": true,
"sAjaxSource" : "./viewController",
"aoColumns":coldata.aoColumns ,
"aoColumnDefs":coldata.aoColumnsRef,
"fnServerData": function ( sSource, aoData, fnCallback ) {
aoData.push( { "name" : "TableName", "value" : "ViewGridDept" },
{ "name" : "Call", "value" : "Data" } );
$.ajax( {
"dataType": 'json',
"type": "POST",
"url": sSource,
"data": aoData,
"success": fnCallback
} );}
[/code]
but my json can not loaded into datatables .kindly help me .
i know this topic is almost same as below link but i do same solution but not get any success.
http://datatables.net/forums/discussion/3442/aocolumndefs-fnrender-.getjson-combo/p1
This discussion has been closed.
Replies