How to obtain data with search()
How to obtain data with search()
ajtkulov
Posts: 1Questions: 1Answers: 0
Hi,
I need to calculate some aggregation functions (like, sum/mean/top-5) for each column.
For standard use case, I can get access to data by
$('#table').dataTable().api().data()
The question is: how to get data with search() method?
Mean, client applies filter in the search-inputbox. I'd like to get filtered data, represented as array/object/etc.
Thanks.
This discussion has been closed.
Answers
use the applied option on data rows
$('#table').dataTable().rows( { search: 'applied' } ).data();
this will give you the rows left after the search is applied.