Compare Elements within a Row - while the table is rendering

Compare Elements within a Row - while the table is rendering

NfernusNfernus Posts: 3Questions: 0Answers: 0
edited June 2012 in General
Hello,

Let me preface by saying I appreciate the product you have created, its very useful.

I am rendering a table using a JSON object and the mDataProp values. I am able to render all my columns, but I am hitting a snag because I want to try and create a new column which compares column 1 to column 5 (they are both integers, I want to know the difference between them). I originally planned to move this out to a .load event after the table loads, but for some reason $(dataTables_filter).load never fires. So, I decided to try and put this in place as one of the columns while rendering the table, and have hit some hiccups. Ive spent a little time trying to get fnGetData to work, but cant quite seem to find the right way of doing this. Any thoughts?
[code]
"aoColumns": [
{ "sTitle" : "Col1", "mDataProp": "Col1" },
{ "sTitle" : "Col2", "mDataProp": "Col2" },
{ "sTitle" : "Col3", "mDataProp": "Col3" },
{ "sTitle" : "Col4", "mDataProp": "Col4" },
{ "sTitle" : "Col5", "mDataProp": "Col5" },
{ "sTitle" : "Col6", "mDataProp": "Col6" },
{ "mDataProp": function() {
var data = oTable.fnGetData('td:eq(0)');
alert(data);
// test = 1;
// test = array_search ($_GET['mDataProp_1']);
return data;
}
}
[/code]
This discussion has been closed.