table.column(0).data().toArray(); gives all records into array even when filter is applied
table.column(0).data().toArray(); gives all records into array even when filter is applied
rahulsonawane
Posts: 6Questions: 2Answers: 0
My DataTable has total 10 rows in it, after applyinng filter it has only 3 rows.
Column 0 is OfferID's of different offers.
Now when I am doing ,
var table = $('#MyTable').DataTable();
var arrayOfferID = table.column(0).data().toArray();
arrayOfferID contains all 10 OfferID from all records even when filter is applied, how to get only 3 filtered records offerID in array
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi rahulsonawane,
You need to add one more piece of information to your
.column()
method -{search:'applied'}
It should read
table.column(0,{search:'applied'}).data().toArray()
An example of this can be found here
Hope this helps,
Sandy
Thank you very much Sandy, that solved my issue