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

".every()" coming back as "undefined", but seems to be correct use of ".DataTables()"

$
0
0

I am using DataTables 1.10.5.

I looked at the FAQ before posting, and found that usually any APIs that come back as undefined indicate a misuse of ".dataTables()" vs. ".DataTables()". I assume that since my code, which attempts to create individual column filtering, is copied directly from the Multi-Search Documentation (with the exception of my own custom selectors, of course), it should be using the correct case, but there are APIs within this copied function which seem to be coming back undefined (I.E. "..columns(...).every")

function multiSearchMaker() {
    // Setup - add a text input to each footer cell
    $('.SMSTable tfoot th').each(function () {
        var title = $('#example thead th').eq($(this).index()).text();
        $(this).html('<input type="text" placeholder="Search ' + title + '" />');
    });

    // DataTable
    var table = $('.SMSTable').DataTable();

    // Apply the search
    table.columns().every(function () {
        var that = this;

        $('input', this.footer()).on('keyup change', function () {
            that
                .search(this.value)
                .draw();
        });
    });
}

Viewing all articles
Browse latest Browse all 82207

Trending Articles



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