Toggle column visibility without name or index
Toggle column visibility without name or index
northamerican
Posts: 5Questions: 2Answers: 0
I am defining my columns as such:
columns: [
{
'data': 'location',
},
]
and in drawCallback I want to toggle its visibility dynamically:
myTable.column('location:name').visible(bool);
i don't want redundancy:
columns: [
{
'data': 'location',
'name': 'location'
},
]
and i don't want to target it by index. what can be done to target it by 'data'?
This discussion has been closed.
Answers
There is no option for that at the moment - and given that
columns.data
can be a function it is unlikely one will be added.Currently the redundancy is the only option to set a name you can use in the selector.
Allan