Custom Filtering - Range Search Performance Issue

Custom Filtering - Range Search Performance Issue

ahcahc Posts: 5Questions: 3Answers: 0

Hello

I am trying to apply a custom range filter to my DataTable, following the example give at http://datatables.net/examples/plug-ins/range_filtering.html

However, I am running into an issue with performance/responsiveness of the DataTable after applying this filter. It seems that the function passed to push() needs to execute every time anything happens with the table (columns being sorted, table being searched or filtered, etc.) instead of just when you want to use the filter. Additionally, this function will run once for every row in the table whenever an action is performed on the table.

For instance, if you had a table with 100,000 records, and you decided to click one of the table headers to sort that column (an action unrelated to the custom range filter), this function would still need to execute 100,000 times resulting in an extremely slowed down responsiveness of the DataTable.

Does anyone have any suggestions for ways around this issue, or other ways of applying a range filter?

Thank you for you time.

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Answer ✓

    The filtering options in DataTables are easily its weakest point at the moment and I plan to give it an overhaul in future. Currently there isn't really a workaround other than to modify the core code, so that it calls your function only once and you can do the loop, rather than DataTables doing the loop.

    Allan

This discussion has been closed.