Custom ColVis with ColReorder

Custom ColVis with ColReorder

gregarroyogregarroyo Posts: 1Questions: 0Answers: 0
edited July 2011 in General
I made my own column visibility feature before I realized one already existed. It worked great until I introduced the ColReorder functionality. Managing which columns to show and hide once they have been reordered has been very difficult. So I thought maybe I could use ColVis but with my own interface. Does anyone know how I might do this?

My interface consists of a lightbox / modal view of checkboxes for all the possible headers. This is built dynamically before the table is even initialized as a data table object. When the user clicks an OK button, the table will update with only the selected headers shown. I suspect there is a method in ColVis.js that I could use to show and hide each header, instead of using fnSetColumnVis().

I believe the main problem I was having with my own implantation was once the columns have been reordered I am unable to accurately identify the index of a currently hidden column to send to fnSetColumnVis(). So as an alternative to using ColVis, if someone knows how I can do this instead, that would be great too.

Once this is solved I will want to reorder the list of checkboxes, similar to how ColVis works. So whatever solution I come to for the above I will need to know the current order of all columns (shown and hidden).

I've been stuck on this for way too long, thanks for any help.
This discussion has been closed.