• Resolved mikeprince

    (@mikeprince)


    Is it possible for column filters to be dependent on column visibility? I.e. if a column is not visible, then any column filter dropdown for it should also not be visible. Conversely, if the column is visible and it has a column filter dropdown, then this should also be visible.

    I am looking at using a colvis button to make a number of columns visible or hidden by the user. Each of these columns needs a column dropdown filter as well. I don’t want to be able to see the column dropdown filter for any columns that are not visible.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    thanks for your question.

    I see what you mean, but will have to disappoint you again, I’m afraid.
    As the Buttons JS code (with Colvis) does not know about the ColumnFilterWidgets dropdowns, it can not automatically hide them. I guess that this is also the result of all this being Extensions to a bigger library.

    Now, you might however be able to achieve this with some custom code. I didn’t look into it more deeply, but it should be possible to add another event handler for clicks on the Colvis checkboxes and then show/hide the dropdowns with your own JS code.

    Regards,
    Tobias

    Thread Starter mikeprince

    (@mikeprince)

    Yes, I should be able to do something with the column visibility event: https://datatables.net/reference/event/column-visibility

    Plugin Author TobiasBg

    (@tobiasbg)

    Hi,

    oh, there’s even a JS event! That’s even better 🙂
    Good to hear that you found this and that it will be helpful!

    Best wishes,
    Tobias

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Column filter dependent on column visibility’ is closed to new replies.