Toggle column visibility without name or index

Toggle column visibility without name or index

northamericannorthamerican Posts: 5Questions: 2Answers: 0
edited March 2015 in Free community support

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'?

Answers

  • allanallan Posts: 63,676Questions: 1Answers: 10,497 Site admin

    what can be done to target it by 'data'?

    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

This discussion has been closed.