Does columnVisibility for columns work?
Does columnVisibility for columns work?
serpi90
Posts: 4Questions: 2Answers: 0
I´m trying to add a button to show all the columns, and another to hide all the columns, according to the example it should work, but it doesn't.
Am i doing anything wrong?
The example
$('#myTable').DataTable( {
buttons: [
{
extend: 'columnVisibility',
text: 'Show all',
visible: true
},
{
extend: 'columnVisibility',
text: 'Hide all',
visible: false
}
]
} );
My fiddle: http://jsbin.com/zegukerevu/1/edit?js,output
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Hi,
I do it with colvisGroup. Dunno why columnVisiblity Code is not working, try it without responsive?
Cheers
Hannes
That solved my problem, thank you.
I'm still wondering if columnVisibility is not working the way it should, or i am misunderstanding the way it should.
If you use:
Then it works weird, showing the first hidden column when clicked.
You can see it here:
http://jsbin.com/xawamurafa/1/edit?js,output