i want fix one row as first row alway by filtering with one column value(admin)
i want fix one row as first row alway by filtering with one column value(admin)
saireddy
Posts: 4Questions: 2Answers: 0
my code
var indexes = displayTable.rows().eq( 1).filter( function (rowIdx) {
return datatable.cell( rowIdx, 0 ).data().toLowercase() === 'Admin' ? true : false;
} );
var data = displayTable.row(indexes).data();
for (i = 0; i < data.length; i++) {
$('.second').find('th').eq(i).html( data[i] );
}
displayTable.row(indexes).remove().draw(false);
This discussion has been closed.
Answers
hello all , please help me on this
I think you want to change your return statement to this:
Kevin
I'm not actually sure what your question is. The
filter()
method has no effect on the data that is displayed in the table, as explained in its documentation.Do you want to keep one row at the top of the table, even if it doesn't match the filtering? If so, put that row into the
thead
.Allan
thanks allan and kevin for fast reply .
i have suppose 4 rows of table data , in second column i want filter my data which is equal to admin then that row needs to be display as first row.
Allan