delete/hide row from datatable
delete/hide row from datatable
could somebody advice me how to delete or hide entire row which has some atribute please?
I think this is the way but dont know how to adjust it for this purpose :
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
if ( aData[8] == "Active" )
{
$('td:eq(7)', nRow).html( 'Active' );
}
return nRow;
},
I think this is the way but dont know how to adjust it for this purpose :
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
if ( aData[8] == "Active" )
{
$('td:eq(7)', nRow).html( 'Active' );
}
return nRow;
},
This discussion has been closed.
Replies
$('#myTableRow').remove();
but how to force datatables to ajax serverprocessing to put some field value into id of row?
if you want to override this, you should look into the object version of aaData, and use DT_RowID. http://www.datatables.net/usage/server-side
I use default server processing and in result there is no id for row :
5
bla bla bla
xxx
2009-09-01 10:00:00
2010-09-01 10:00:00
zzz
bbb
aaa
Stopped
2
ble ble ble
yyyy
2011-08-01 15:00:00
2011-09-30 15:15:00
..... etc
is it any sample available to see how to create on server side object version of aaData?
[code]
$row->DT_RowId = $aRow[ $aColumns[8] ];
[/code]
...in onload function of datatables I got this :
[code]
"fnRowCallback": function( nRow, aData, iDisplayIndex ) {
if ( aData[8] == "Active" )
{
$('#Active').remove();
//$('td:eq(7)', nRow).html( 'Active' );
}
return nRow;
},
[/code]
...even if my data has some row with row id = Active this row is not removed :(
I just filter aData for each table separately by
[code]
oTable1.fnFilter( 'filtered_text1', 8 );
oTable2.fnFilter( 'filtered_text2', 8 );
...
[/code]