Send column title with we do a call to the server

Send column title with we do a call to the server

marcpiratmarcpirat Posts: 51Questions: 18Answers: 0
edited February 2014 in General
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

Replies

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin
    This has come up a couple of times the last few days in fact.

    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
  • marcpiratmarcpirat Posts: 51Questions: 18Answers: 0
    ok thanks a lot
This discussion has been closed.