Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82387

fn.dataTable.ext.search.push for only one datatable?

$
0
0

Hi.

I use the code "initComplete: function () { .fn.dataTable.ext.search.push etc etc..." (full code below) and it messes up my other datatables.
I already put it inside of var table = $('#datatable').DataTable( {} ) and given the different datatables unique IDs.

How to implement this code for only ONE datatable?

Datatable: http://live.datatables.net/furexita/1/edit (datatables is not being loaded and I don't know why)

initComplete: function () {
  $.fn.dataTable.ext.search.push(
    function( settings, searchData, index, rowData, counter ) {
        // Don't display rows if nothing is checked
        if (filtered.length === 0) {
            return false;
        }

        if (filtered.includes(searchData[10])) {
             return true;
        }
        return false;
    }
  );
}

Thank you
- Jonas


Viewing all articles
Browse latest Browse all 82387

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>