SearchPanes: hide 'Show All/Collapse All' buttons

SearchPanes: hide 'Show All/Collapse All' buttons

montoyammontoyam Posts: 568Questions: 136Answers: 5
edited August 2021 in SearchPanes

I see there are new buttons. Can they be hidden when configuring the SearchPane?

This question has accepted answers - jump to:

Answers

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @montoyam ,

    Yes, you can disable the collapsing of all of the panes using searchPanes.collapse and setting it to false. Take a look at this example.

    Thanks,
    Sandy

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

    Just a note to say that functionality is unreleased and still in the nightly releases here. We're aiming to release it today (or possibly tomorrow if the wind's against us...),

    Colin

  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    perfect. yes, I forgot to mention i was using the nightly because of the page navigation fix that was yet to be pushed out :)

  • montoyammontoyam Posts: 568Questions: 136Answers: 5

    oh, I have Search Panes on most of my many dataTables. Is there a way to make that the default setting so I don't need to add it in all my tables?

  • sandysandy Posts: 913Questions: 0Answers: 236
    Answer ✓

    Hi @montoyam ,

    Something like this is probably the closest that you will get without affecting every single initialisation.

    $.fn.dataTable.SearchPanes.defaults.collapse = false;
    $.fn.dataTable.SearchPane.defaults.collapse = false;
    

    These two lines override the defaults on the two classes. You could put it in a script or a script tag anywhere after the SearchPanes code is included on the page. The other option would be to host the SearchPanes code yourself, and change the default in your own source file.

    Thanks,
    Sandy

  • sandysandy Posts: 913Questions: 0Answers: 236

    Also just a note to say that this has now been released in 1.4.0 and isn't subject to only the nightly builds.

    Thanks,
    Sandy

Sign In or Register to comment.