Using a shared ColVis control on more than two tables?
Using a shared ColVis control on more than two tables?
Hi,
I am investigating/learning about DataTables and I have the ColVis example for "Two tables with shared controls" working. However, I cannot seem to determine via the forum or via experimentation whether or not ColVis can be shared across more than two tables. Is that possible? I'm also a bit new to jQuery.
Here is an example with three tables. https://jsfiddle.net/whnju7u8/1/
ColVis effects the first two tables while the third remains unchanged.
The second column on all tables is initially hidden.
Thanks.
This question has an accepted answers - jump to answer
Answers
My understanding is that the expression :gt(0) should select all elements at an index greater than index within the matched set. However, in this case, it stops iterating after the first two tables.
Thanks in advance..
This is the first time that the plural nature of the API has caught me out - after a bit of debugging I realised that the
column()
singular method was being used. The result is that only a single column from a single table is being selected when you use it.Simply using
columns()
allows it to work as expected: https://jsfiddle.net/whnju7u8/2/ .Something I need to update in the documentation (and remember)!
Allan
:-) well, with you being an author of this amazing library, I simply lay roses at your feet and offer my many thanks.
Bill