On my View I have 4 tables. I am using jQuery Datatables for each of the tables so for one of my records that I'm displaying in the view looks like this:
WHAT I HAVE
var countAllTablesRows = $("table tbody.teu-tbody tr").length;
console.log("Total Rows In Every Table on Page - " + countAllTablesRows);
var rowCountMinusOne = countAllTablesRows - 1;
console.log("Total Rows In Every Table on Page Minus One - " + rowCountMinusOne);
MY GOAL
When a user clicks the "Delete" link, I want to count all of the rows in each of the tables tbody elements. However, I only want to count the table rows where there is actual data.. not the tables that have one row saying "No data available in table".
I was thinking of maybe using .each()
to only get tables that don't contain "No data available in table", but I'm not sure of how to attack this.
Any help is appreciated.