Filtered data from column
Filtered data from column
jmcshan1
Posts: 9Questions: 3Answers: 0
I just wanted to put this little script out there in case others were looking for something similar. I needed to get only the displayed rows from the table after applying a filter. Here's the 5 line script to add this to the column API:
$.fn.dataTable.Api.register('column().filteredData()', function() {
return this.table().settings()[0].aiDisplay
.map(function(it) {
return this.data()[it];
}, this);
});
This discussion has been closed.
Replies
Similarly for filtering the data from the whole table: