Does the filter() API support HTML-backed tables?

Does the filter() API support HTML-backed tables?

dr_bartodr_barto Posts: 4Questions: 2Answers: 0

My table is populated statically in HTML. Running the filter code below does not work (the filter callback is never executed); running the same code with a programmatically populated table (via the data property) works as expected.

var filteredData = this.table.column(3).data().filter(function(value, index) {
  console.log('filter called');
  return value > 20 ? true : false;
});

Is this behavior by design, or should the HTML-backed table be filterable as well?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,810Questions: 1Answers: 10,516 Site admin
    Answer ✓

    Yes it should be, and this example shows it working. We'd need a link to a test case, per the forum rules, showing the issue.

    Allan

  • dr_bartodr_barto Posts: 4Questions: 2Answers: 0

    Thanks for the example -- apparently I had an error in my code; after some copy&pasting from the sample, it works now :)

This discussion has been closed.