Send column title with we do a call to the server
Send column title with we do a call to the server
hi
right now i feed a datatable, this way.
[code]$('#example').dataTable({
"sDom": "<'row'<'col-xs-6'T><'col-xs-6'f>r>t<'row'<'col-xs-6'i><'col-xs-6'p>>",
"sAjaxSource": "/test/testDataTable",
"bProcessing": false,
"bServerSide": true,
"fnServerData": function(sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "GET",
"url": sSource,
"data": aoData,
"success": fnCallback
});
}
});
[/code]
the returned value is
[code]{ "sEcho": 2 , "iTotalRecords": 2, "iTotalDisplayRecords": 2, "aaData": [ [ "WebKit", "Firefox 1.0", "Win 98+ / OSX.2+", "1.7", "A" ], [ "Gecko", "Firefox 2.5", "Linux / OSX.2+", "1.8", "A" ] ]} [/code]
is there a way to include the title of every column ?
thanks
right now i feed a datatable, this way.
[code]$('#example').dataTable({
"sDom": "<'row'<'col-xs-6'T><'col-xs-6'f>r>t<'row'<'col-xs-6'i><'col-xs-6'p>>",
"sAjaxSource": "/test/testDataTable",
"bProcessing": false,
"bServerSide": true,
"fnServerData": function(sSource, aoData, fnCallback) {
$.ajax({
"dataType": 'json',
"type": "GET",
"url": sSource,
"data": aoData,
"success": fnCallback
});
}
});
[/code]
the returned value is
[code]{ "sEcho": 2 , "iTotalRecords": 2, "iTotalDisplayRecords": 2, "aaData": [ [ "WebKit", "Firefox 1.0", "Win 98+ / OSX.2+", "1.7", "A" ], [ "Gecko", "Firefox 2.5", "Linux / OSX.2+", "1.8", "A" ] ]} [/code]
is there a way to include the title of every column ?
thanks
This discussion has been closed.
Replies
Currently no - there is not. I might look at it for 1.11, but for the moment you would need to make a custom Ajax call. See: http://datatables.net/forums/discussion/19683
Allan