How to make both ColVis and Responsive work in DataTables as they should?

How to make both ColVis and Responsive work in DataTables as they should?

chrismaliszewskichrismaliszewski Posts: 11Questions: 3Answers: 0
edited November 2014 in Free community support

Hi everyone.

I'd like to use both Responsive and ColVis extensions in my DataTables but I found that they don't work as they should with both are called.

For example: if I turn off visibility of column using ColVis and than change zoom of page, Responsive either makes column visible or adds it to + sign. What is more column which is made visible again in ColVis is still seen as invisible.

How to make:
1) Responsive doesn't show column in + when ColVis disabled column,
2) Responsive doesn't "re-visible" column with zoom change,
3) ColVis in small screens to not show columns out of + after disabling and than enabling column in list (column moves from + to normal view, column should stay in + when visible and disapear from + when invisible (read 1)).

Should I add some class in ColVis to distinguish "valid" column from rest in Responsive? Or you have other ideas?

Thank you for your help in advance!

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 63,696Questions: 1Answers: 10,500 Site admin
    Answer ✓

    Responsive controls the visibility of the columns in the table, so ColVis and Responsive are effectively incompatible.

    Allan

  • chrismaliszewskichrismaliszewski Posts: 11Questions: 3Answers: 0

    Both of them control it so I was thinking to add sth to distinguish ones invisibility from the other.

    I also found out that ColVis still doesn't work with State saving...

    I think I'll need to turn it (ColVis) off. Pity :(.

  • allanallan Posts: 63,696Questions: 1Answers: 10,500 Site admin

    Yes, they would require another layer in between them to allow them to work together, or for Responsive to implement its whole column hiding. Possibly of course, but not something I have implemented yet.

    I also found out that ColVis still doesn't work with State saving...

    Works okay for me. Can you link me to a page that shows it not working (without Responsive, since Responsive would override anything state saved).

    Allan

This discussion has been closed.