Skip to content

Footer column search - only searchable columns #2544

Answered by yajra
rickgoemans asked this question in Q&A
Discussion options

You must be logged in to vote

As per initComplete docs, we can use settings and json parameter. You can fetch the column definitions from there.

            ->initComplete("function (settings, json) {
                this.api().columns().every(function (index) {
                    var column = this;
                    var colDef = settings['aoColumns'][index];

                    console.log(column, colDef)

                    var input = document.createElement(\"input\");
                    $(input).appendTo($(column.footer()).empty())
                    .on('change', function () {
                        column.search($(this).val(), false, false, true).draw();
                    });
                });

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rickgoemans
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2544 on December 09, 2020 06:21.