ColVis Button vs. column.visible inconsistency

ColVis Button vs. column.visible inconsistency

RagnarGrootKoerkampRagnarGrootKoerkamp Posts: 48Questions: 14Answers: 1
edited July 2016 in Buttons

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

  • allanallan Posts: 63,577Questions: 1Answers: 10,483 Site admin

    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

This discussion has been closed.