Row Details

Row Details

aquiqueaquique Posts: 1Questions: 0Answers: 0
edited April 2013 in General
Good afternoon,

Allan - all I have to say is "WOW - Thank you!" on this great platform!

Hopefully the code below will shed some light on my issue. Anytime I add data to with fnRender and aData the values also show up in the details table. SO I think oTable is being used to render both tables, Correct? if so, how would I separate the information and formatting being used in the summarized table from the details table?

Thanks in advanced!


[code]

var oTable;


/* Formating function for row details */

function fnFormatDetails ( nTr )
{
var aData = oTable.fnGetData( nTr );
var sOut = '';
sOut += '';
sOut += '';
sOut += 'Patient InformationPatient DiabeticCity';
sOut += '';
sOut += '';
sOut += ''+aData[4]+' '+aData[5]+'';
sOut += ''+aData[3]+'';
sOut += 'Address'+aData[7]+'';
sOut += ''+aData[8]+'';
sOut += ''+aData[9]+'';
sOut += 'State'+aData[10]+'';
sOut += 'Zip Code'+aData[11]+'';
sOut += 'Age'+aData[12]+'';
sOut += 'DOB'+aData[13]+'/'+aData[14]+'/'+aData[15]+'';
sOut += '';
sOut += '';
sOut += 'Surgical Information';
sOut += 'Anatomical Parts'+aData[13]+' '+aData[14]+'Anatomical Location';
sOut += 'Primary Insurance:'+aData[15]+' '+aData[16]+'';
sOut += ':'+aData[17]+' '+aData[30]+'';
sOut += '';
return sOut;
}

$(document).ready(function() {
oTable = $('#patient').dataTable( {
"bJQueryUI": true,
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/details_col_targets.php",
"bDeferRender": true,
"aoColumns": [
{"mData": 0},
{"mData": 1},
{"mData": 2},
//{"mData": function ( oObj ) {return oObj.aData[4] +' '+ oObj.aData[5];},"bVisible": true},


{"mData": 4},

//{"mRender": function ( data, type, row ) {return row.aData[4] +' '+ row.aData[5];}},
{"mData": 5},
//{"mData": 45},

//{ "sClass": "center","bVisible": true, "aTargets": [ 0,1,2] },
//{ "mData": 8,"bVisible": true, "aTargets": [ 3 ] },

//{"fnRender": function ( oObj ) {return oObj.aData[50] +'/'+oObj.aData[51] +'/'+ oObj.aData[52];},"bVisible": true, "aTargets": [ 4 ]},
//{"fnRender": function ( oObj ) {return oObj.aData[45];},"bVisible": true, "aTargets": [ 5 ]},

{ "bVisible": false, "aTargets": [ '_all' ] }]

//"aaSorting": [[1, 'desc']]*/
} );

$('#patient tbody td img').live( 'click', function () {
var nTr = $(this).parents('tr')[0];
if ( oTable.fnIsOpen(nTr) )
{
/* This row is already open - close it */
this.src = "./images/details_open.png";
oTable.fnClose( nTr );
}
else
{
/* Open this row */
this.src = "./images/details_close.png";
oTable.fnOpen( nTr, fnFormatDetails(nTr), 'details' );
}
} );
} );
[/code]
This discussion has been closed.