Count cells with specific value and row class
Count cells with specific value and row class

Hi all,
I am trying to find a way to count the number of cells with a particular value for selected rows (or cells with a particular class), Is this possible? Something like:
dt.rows( '.selected' )
.data()
.indexOf('cellValue')
.count()
Or where the row has a class of selected and the cell has a class of bg-success
dt.rows( '.selected' )
.cells('.bg-success')
.count()
Thanks
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
The first option, but with
filter()
rather thanindexOf()
is probably the way to do this.The other option is to use
row-selector
as a function and have it select only the rows of interest.Allan
Thanks again for your help Allan, much appreciated.