Giving a row a custom Id
Giving a row a custom Id
sknecht
Posts: 2Questions: 1Answers: 0
I get new data over websockets and i can add these data with:
var t = $('#example').DataTable();
t.row.add( [id, name,dataset] ).draw( false );
but i also receive the id of the data that needs to be removed from the table. How can i give the row an ID so that i can remove it later on. I only found the way to click on it.. but i don't want any user interaction.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You can use
rowId
to designate the column containing the ID. Then userow()
to get the row containing the desired ID usingrow-selector
as shown here.Here is an example:
http://live.datatables.net/yudomeha/1/edit
Kevin
@kthorngren
Thanks for your answer! That is apparently a way to do it. However out of curiosity, how would it work when the id is not a column itself?