How

How

YoanAshYoanAsh Posts: 2Questions: 1Answers: 0
edited May 2019 in Free community support

Hi,

How to count the number of rows with a specific value in a column of a filtered array.

    var table = $('#table').DataTable( {
      "drawCallback": function ( ) {
          var api = this.api();

          var count = api.rows({filter :'applied'})
                            .column( 7 )
                            .data()
                            .filter( function (value, index) {
                                  return value=="myValue" ? true : false;
                            }).length;
      }
    }

This returns me the number of value of all the table, without the search filters.

Thanks for your help

Answers

  • YoanAshYoanAsh Posts: 2Questions: 1Answers: 0

    Hi find the solution :

    api.column(7, {search: 'applied'}).data()

This discussion has been closed.