How to count rows with a match value?
How to count rows with a match value?
grrdchvzs
Posts: 2Questions: 1Answers: 0
I need to count the number of rows with a specific value and display it in the HTML document.
I use AJAX method POST with a PHP file.
Answers
Use
rows()
with therow-selector
as a function to match your criteria. Chaincount()
to get the resulting row count.Kevin
initComplete: function() {
console.log(tableArchives.rows('anyvalue').count());
}
I tried it this way and had no results
Look at the function example in the
row-selector
docs.The variable
tableArchives
is likely not available ininitComplete
. Instead usethis.api()
. Something like this:Kevin