When using DataTables how do I get column values for the rows returned by fnGetNodes? I’m using the function below that returns the selected rows. I want to use the return value of this function to delete the selected rows from the database. However, to do that I need the uniqueid value of each selected row. One other potential problem is that the uniqueid attr is marked with:
bVisible: false
so that it isn’t actually displayed to the user as it is of no interest to them.
/* Get the rows that are selected */
function fnGetSelected( oTableLocal )
{
var aReturn = new Array();
var aTrs = oTableLocal.fnGetNodes();
for ( var i=0 ; i<aTrs.length ; i++ )
{
if ( $(aTrs[i]).hasClass('row_selected') )
{
aReturn.push( aTrs[i] );
}
}
return aReturn;
}
You would need to use the fnGetData() method for DataTable. If you pass the selected row it will return an array of the row that you want.