How to add multiple json values in a single cell of dataTable.
I am going through the datatables documentation but cant get a clear example.
I have the following JSON string which I am accessing it through a session into a dataTable.
<textarea id="Report" type="text" style="" name="Report">
[
{
"Identifier": "0",
"LastName": "Cooper",
"FirstName": "Benny",
"MiddleInitial": "P",
"MRN": "7854753",
"Age": "30",
"Gender": "Female",
"Location":
{
"Bed": "1",
"Room": "A",
"unit": "NU1",
"facility": "Fac1"
},
"ServiceDate":"05/03/2013",
"ChargeAndDx":"99222 - 410.01,428",
"BillingProvider":"Palmer, James",
"title":"Add",
"start":"2013-08-07",
"url":"#",
"textColor":"red"
}] </textarea>
on the other page where I am accessing the session in the datatable is aas follows:
$(document).ready(function (){
var ReportData=JSON.parse(document.getElementById("Report").innerHTML);
Report=$('#patientDataTables').dataTable
({
"bJQueryUI":true,
"bScrollCollapse":true,
aaData:patientReportData,
"aoColumns":
[ {"mData":"LastName","sClass":"left"},
{"mData":"ServiceDate","sClass":"left"},
{"mData":"ChargeAndDx","sClass":"left"},
{"mData":"BillingProvider","sClass":"left"},
{"mData":"null","sClass":"center","sDefaultContent":"<a href='' class='editor_menu'>menu</a>"}
]
});
In my datatable where the LastName appears I want the FirtName, Middle Initial, MRN and age as well.
How is that done. If some one knows a quick way to do this.
See Question&Answers more detail:
os