Remove a row based on a column value.
Remove a row based on a column value.

Hi!
I have a datatable that has 4 columns like this:
| Username | Email | Firstname | Lastname |
Lets say that I have 2 rows one with the username John123
and one with Smith321
.
I want to remove the row with John123
but I do not know the index if said row, what would be the easiest way to remove that row from the datatable using Javascript.
Thank you for the help!
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I just happen to have an example for this.
http://live.datatables.net/gimefafe/1/edit
It uses uses
filter()
to find the row androws().indexes()
to get the indexes of the found rows. Then is usesrows().remove()
to delete from the table.Kevin
@kthorngren Thank you for the help!