adding multiple rows to jquery Datatables dynamically
Posted
by
arrowill12
on Stack Overflow
See other posts from Stack Overflow
or by arrowill12
Published on 2013-07-01T16:48:10Z
Indexed on
2013/07/01
17:06 UTC
Read the original article
Hit count: 274
jQuery
|datatables
I am trying to add multiple rows at once to a jQuery Datatable. I would like to be able to create a string such as the one below and call a function to add these elements as rows in the table. Is there a function that will allow me to do this?
var trString = "<tr class='custom class'><td></td><td></td></tr><tr class='custom class'><td></td><td></td></tr><tr class='custom class'><td></td><td></td></tr>"
I have seen the fnAddData function but I would not be able to add my custom classes dynamically to the rows using that function. Also I have tried fnAddTr but I keep receiving an error saying my object does not have the method "getelementsByTagName"
again, is there a function that will allow me to add a string of "" to a datatable?
© Stack Overflow or respective owner