How to access all columns inside initComplete function ?

How to access all columns inside initComplete function ?

janbugujanbugu Posts: 4Questions: 2Answers: 0

Is there a way to get access to the data table instance inside initComplete function ?
As a example what i want is something like below. Thanks.

var table = $('#example').DataTable({
"initComplete": function(settings, json) {
var columns = columns();
}

Answers

  • jr42.gordonjr42.gordon Posts: 305Questions: 2Answers: 49

    What is the end goal you are trying to achieve?

  • janbugujanbugu Posts: 4Questions: 2Answers: 0

    Thanks jr42.gordon for the reply. Goal was to apply column search for each column after the table is initialized. found a way out of it by using this.api().columns()

    var table = $('#example').DataTable({
    "initComplete": function(settings, json) {
    var columns = this.api().columns();
    }

This discussion has been closed.