ColVis Button vs. column.visible inconsistency
ColVis Button vs. column.visible inconsistency
![RagnarGrootKoerkamp](https://datatables.net/forums/uploads/userpics/057/nG9CYCQCC68AQ.png)
I accidentally assigned 0
and 1
(integers, not chars/strings) to column.visible
instead of false
and true
. The columns were hidden correctly (that is, columns with column.visible
set to 0
were hidden and those set to 1
shown), but the colvis button had some very weird behaviour. When clicking the button corresponding to the last column in the button collection, the visibility of that column is toggled correctly, but the buttons for all columns above/before the clicked column would incorrectly toggle their state.
I suspect this is due to some inconsistent usage of ==
in the column.visibility
handling of datatables and ===
in the buttons plugin.
Since assigning integers is undocumented, this is not necessarily a problem, but consistent behaviour would be nice for debugging purposes.
Replies
Yup - you are in uncharted waters if you use a type that isn't detailed in the documentation for a parameter and there be sharks there ;-).
I'm not too surprised by this to be honest and I'm sure there are many other instances of problems with types if the documented types aren't followed (string for
pageLength
for example).Sticking to what the documentation says is acceptable is the way forward since that is what we test for.
Allan