columns().every() and search()

columns().every() and search()

reimaxreimax Posts: 10Questions: 3Answers: 0

Hi,
i try use datatable and jo jquery. I need add search to columns. my code:
var datatable = new DataTable('.table', {});

datatable.columns().every( function () {
var that = this;

    document.querySelectorAll('input[type=text]', this.footer() ).forEach(function(element) { 
        element.addEventListener("keyup", function(event) {
            event.preventDefault();
            if ( that.search() !== this.value ) {
                console.log(this.value );
                that.search( this.value ).draw();
            }
        });
    });
});

this not work and i need help.

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.