SearchPanes how to show filter for all columns

SearchPanes how to show filter for all columns

ralfeusralfeus Posts: 24Questions: 6Answers: 1

Hi all,
I have a table with 5 columns

But when I add SearchPane I see a filter only for 3 columns:

SearchPanes manual says all columns are filtered by SearchPanes by default. But clearly it's not the case for me. How to I have filter for all columns?

This question has an accepted answers - jump to answer

Answers

  • ralfeusralfeus Posts: 24Questions: 6Answers: 1

    Moreover even if I set options:
    searchPanes: {
    columns: []
    }
    of the datatable, which in my opinion should show no column filters at all or columns: [1], which should show first column filter I still get same set of column filters shown

  • kthorngrenkthorngren Posts: 21,172Questions: 26Answers: 4,923
    Answer ✓

    columns: []

    I guess, depending no how the check is made, [] could result in all the columns as noted in the searchPanes.columns docs:

    The default value for the searchPanes.columns parameter is undefined. When this default value is in place all of the columns will be considered when creating searchPanes.

    But when I add SearchPane I see a filter only for 3 columns:

    Probably has to do with the threshold. The searchPanes.threshold docs explain it. This example too.

    Does this force panes to show/hide example help?

    Kevin

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    Yep, likely to be due to the threshold as Kevin said. This thread might help, it's discussing the same thing.

    If not, we're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • ralfeusralfeus Posts: 24Questions: 6Answers: 1

    The default value for the searchPanes.columns parameter is undefined. When this default value is in place all of the columns will be considered when creating searchPanes.

    That's right. And when I didn't provide any value for searchPanes.columns I still saw same columns.

    Does this force panes to show/hide example help?

    Force showing/hiding did help, yes. Thank you for that.

  • sandysandy Posts: 913Questions: 0Answers: 236

    Hi @ralfeus ,

    The default value for the searchPanes.columns parameter is undefined. When this default value is in place all of the columns will be considered when creating searchPanes.

    Just to clear up what the docs are saying here. It means that each column will be processed and a decision made on whether to display it or not. As Kevin referenced, there are more details on this at the searchPanes.threshold doc page, but you will only be seeing the panes for columns that meet that threshold. It does not mean that each column will have a pane by default.

    Hope this helps,
    Sandy

This discussion has been closed.