Issue Combining SearchPanes and Column Visibility

Issue Combining SearchPanes and Column Visibility

mayur.patil@smart360.bizmayur.patil@smart360.biz Posts: 2Questions: 0Answers: 0

Hi DataTables Team,

I'm currently working on a project where I need to use both the SearchPanes and Column Visibility features of DataTables. I noticed that when these features are combined, there seems to be a problem with synchronization, as SearchPanes sometimes reflects hidden columns or behaves unexpectedly when columns are toggled.

Here are the steps to reproduce the issue:

Initialize a DataTable with both SearchPanes and Column Visibility enabled.
Hide one or more columns using the Column Visibility control.
Observe the behavior of the SearchPanes — they still show search options for hidden columns.
Expected Behavior:
SearchPanes should dynamically update to reflect only the visible columns or seamlessly handle changes in column visibility.

Current Behavior:
SearchPanes continues to display values for hidden columns, which creates confusion for users.

Could you please advise on the correct configuration or workaround to ensure these two features work well together? If this is a known issue, is there any timeline for a fix or an alternative approach I can use?

Thanks for your assistance and support.

Replies

  • allanallan Posts: 63,930Questions: 1Answers: 10,537 Site admin

    It is indeed quote possible for hidden columns to be used with SearchPanes. If you want to discount certain columns from SearchPanes, use searchPanes.columns.

    Allan

  • mayur.patil@smart360.bizmayur.patil@smart360.biz Posts: 2Questions: 0Answers: 0

    Thank you for your response. I appreciate the guidance regarding the searchPanes.columns option.

    I understand that I can manually specify columns for SearchPanes, but my requirement is to dynamically update the SearchPanes based on the current column visibility state. Specifically:

    -When a column is hidden using the Column Visibility control, I would like SearchPanes to automatically exclude that column from the available search options.
    -Conversely, when a hidden column is made visible again, its corresponding SearchPane should reappear without requiring a page refresh or manual reinitialization.

    Could you please advise if there is a built-in way to handle this scenario or suggest an event-driven approach to achieve this dynamic synchronization?

    Thanks for your continued support.

Sign In or Register to comment.