Quantcast
Channel: DataTables 1.9 — DataTables forums
Viewing all articles
Browse latest Browse all 1816

aoColumnDefs,aoColumns,json,serverside

$
0
0
i have following json from server side through ajax call
{"aoColumns":[{"mDataProp":"deptName","sTitle":"Department Name"},{"mDataProp":"deptId","sTitle":"Department Id"}],"aoColumnsRef":[{"aTarget":["2"]},{"aTarget":["1"]}]}


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

Viewing all articles
Browse latest Browse all 1816

Trending Articles