I am trying to use DataTables and trying to see if i can get it implemented onto my site.
I've tried searching the DataTables and Stack Overflow forums and Googling, but haven't found anything yet that answers my question. Probably I've read over it somewhere, but I am hoping someone will help me.
Case
- a large number or table rows with 10 inputs on every table row (tr)
- what i need: to get all the input values for every row (visible or not) WITH the
tr.data()and/ortd.data()that might be set for that row.
Right now I am using this:
$('#example').DataTable().rows().data().toArray()
and getting this for every row:
["<input type=\"text\" value=\"0\">", "<input type=\"text\" value=\"0\">", "<input type=\"text\" value=\"0\">", "<input type=\"text\" value=\"0\">", "<input type=\"text\" value=\"0\">"]
a) I don't see the data() attribute that was attached to that row, how to get it?
b) how can I get the value of for instance row 0, first input? In jQuery I would use $('tr').first().find('input').val() or give it an id but how can I do something like that with the DataTables output? looking at what the above output gives me, i have no idea yet how to accomplish that. (So for all rows, not only the visible ones)
Not every row is in the DOM, so there must an object or something holding all table rows from where I can extract the value for every input on every table row and also get their data() attribute.