How to retrieve data associated with current search?

How to retrieve data associated with current search?

loukinglouking Posts: 259Questions: 52Answers: 0

I am using yadcf to filter a table, which I believe uses DataTables.search() to do the filtering.

When the table is drawn after yadcf filtering ( on ( 'draw.dt', ... ) ) I want to pull the filtered data out of the table for further processing.

I see data() and rows().data() both return the full unfiltered dataset.

Is there a way to retrieve the filtered dataset?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    edited October 2017

    Yes, with the selector-modifier for the rows() method. e.g.:

    table.rows( { search: true } ).data();
    

    Allan

    edit - Linked to the wrong type.

  • loukinglouking Posts: 259Questions: 52Answers: 0

    Thanks for pointing me to selector-modifier. I think you must mean

    table.rows( { search: 'applied' } ).data();
    
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    Doh - yes indeed I did!

    Allan

This discussion has been closed.