I’m using ajax to deliver the table data. As part of the ajax response there may, or may not, be column heading information.
What I’m therefore trying to do is toggle autoColumns depending on whether column information is present in the ajax response. But I cannot see a way to change that post-constructor.
Simply calling table.setColumns() isn’t enough if autoColumns is set – the new column information is ignored.
This is what I want to achieve:
var table = new Tabulator("#events", {
autoColumns:false,
ajaxURL: "/my/url",
ajaxResponse: function(url, params, response) {
if (response['columns']) {
table.setColumns(response['columns'])
// How do I do the following?
table.autoColumns = false
} else {
table.autoColumns = true
}
return response
},
...