Custom filters are even more broken

Custom filters are even more broken

misterminitmisterminit Posts: 2Questions: 2Answers: 0

According to https://datatables.net/forums/discussion/5228/tip-custom-filters-and-multiple-tables you could just add a dummy setting; however this option is no longer valid, which causes the example to no longer be functional.

It also is part of the "old" api-base; where you stated to rework the api to allow adding a search/extension to a single DT, however I can't find any documentation about this.

What is the new approach to accomplish this?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,446Questions: 1Answers: 10,054 Site admin
    edited September 2018 Answer ✓

    You still need to use a little bit of logic in the search plug-in I'm afraid:

    $.fn.dataTable.ext.search.push(
        function( settings, searchData, index, rowData, counter ) {
            if ( settings.nTable.id !== "tableIdOfInterest" ) {
                return true;
            }
    
            // filtering logic for `tableIdOfInterest`
        }
    );
    

    Yes its c**p. Sorry. This is still something that will be resolved in v2 (which is actually underdevelopment now!).

    Allan

This discussion has been closed.