I have a table with various columns and many rows. To simplify this, I just need to know how many rows are billable (in this case, column 2). In other words, how many rows in column 2 have the text "y"? Anyways, this is what I've tried so far:
jQuery
var billable = 0;
// attempt 1
table.rows().eq(1)( function () {
if(table.data() === 'y'){
//priceTotal+=parseInt(table.cell(row,0).data());
alert('This is the billable column, now count which equal "y".')
billable++;
}
});
// attempt 2
column(2).data() === "y"){
alert('This is the billable column, now count which equal "y".')
billable++;
}