How to get ColVis menu to update when I dynamically hide/show columns

How to get ColVis menu to update when I dynamically hide/show columns

djmdjm Posts: 20Questions: 4Answers: 0
edited August 2014 in Free community support

Hello.

How can I dynamically show/hide columns and get the ColVis popupmenu to keep in sync with this?

The example code (for "rebuild") here:
http://www.datatables.net/extensions/colvis/api
seems not to work.

(1) "TypeError: table.fnSetColumnVis is not a function"

If I instead call
table.column(2).visible(false);
the column gets hidden as expected.

However when the user clicks the colVis button, all the checkboxes are ticked (the one for column 2 should be unchecked since it was just hidden).
Seems "fnRebuild" isnt working?

(2) "TypeError: oTable.fnSettings is not a function" // line 880
" nTable = oTable.fnSettings().nTable;"

Answers

  • djmdjm Posts: 20Questions: 4Answers: 0

    Would be very grateful for any suggestions here.
    Thanks in Advance

  • AllanCochraneAllanCochrane Posts: 41Questions: 1Answers: 2
  • djmdjm Posts: 20Questions: 4Answers: 0

    Hi.

    Thamks for the suggestion. However this function ("fnRebuild") seems not to be working (the entries in the popup menu doesnt get updated). And the other (fnSetColumnVis) seems to be non existant

    Any other suggestions that save me having to implement the colVis functionality all manually would be very welcome

This discussion has been closed.