add another column to the returned json
add another column to the returned json
dreams1981
Posts: 5Questions: 0Answers: 0
I have the same problem as http://datatables.net/forums/comments.php?DiscussionID=1581&page=1(how to put out content in a column what is not from the DB).
Allan said: in that section will add another column to the returned json.
[code]$sOutput .= '"column value",';[/code]
But I still don't know how to add another column to the returned json!
[code]
var oTable = $('table').dataTable({
bPaginate: true,
bProcessing: true,
sAjaxSource: "WebService1.asmx/GetData",
fnServerData: function ( sSource, aoData, fnCallback ) {
$.ajax({
"dataType": "json",
"type": "POST",
"url": sSource,
"success": fnCallback
});
}
});
[/code]
Allan said: in that section will add another column to the returned json.
[code]$sOutput .= '"column value",';[/code]
But I still don't know how to add another column to the returned json!
[code]
var oTable = $('table').dataTable({
bPaginate: true,
bProcessing: true,
sAjaxSource: "WebService1.asmx/GetData",
fnServerData: function ( sSource, aoData, fnCallback ) {
$.ajax({
"dataType": "json",
"type": "POST",
"url": sSource,
"success": fnCallback
});
}
});
[/code]
This discussion has been closed.
Replies
[code]
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( 'url', 'notes', '" "', 'ticket_id' );
[/code]
I was having issues with including extra columns until I added the double quotes inside the single quotes.