I can't seem to find this anywhere. I have a dataTable like this one, and I want to be able to count the number of rows in the dataTable in javascript. how would that be accomplished? thanks!
I need it in javascript because I want to iterate through the datatable and check to see if any rows cantain certain data in them.
EXAMPLE PSEUDOCODE
var tableSize = someway to get table size;
for (i = 0; i < tableSize; i++) {
if (dataTable.row(i).value == "someValue") {
//do something
}
It would be easier to count the rows with jQuery:
var tableSize = $('#myTable tbody tr').length;
Demo: http://jsfiddle.net/YLVuK/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With