Add row and custom data
Add row and custom data
marcpirat
Posts: 51Questions: 18Answers: 0
hi
I need to add row dynamicly to the datatable and after i will do a safe.
var specsTable = $('#specsTable').DataTable({
...
});
I can use row.add like
specsTable.row.add( [
$("#field1").val(),
$("#field2").val()
]);
I would to add some attribute (like data-id) for some field
Is there a way to do it?
thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi @marcpirat ,
You can use
node()
andto$()
to get the node of the added row, something like this:Cheers,
Colin