DataTable Image -> When i am trying to get header name like this.. then i got only first column name which is NAME... But i need to get all headers name. How to get all Header Name ?
this.api().columns().every( function ($i) {
var column = this;
var order = this.order();
var title = this.column(order[0][$i]).header();
var tt = $(title).html();
console.log(tt);
})
Seems a little bit overcomplicated :
this.api().columns().every(function() {
console.log( this.header().textContent )
})
will do the "trick".
This worked out for me:
table.columns().header().map(d => d.textContent).toArray()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With