If no searchpanes exist, disable show button

If no searchpanes exist, disable show button

wallabe123wallabe123 Posts: 23Questions: 12Answers: 0

I have a table that uses a searchPane on one column. There is a button which collapses/shows the searchPane if it exists (if the column can be filtered). Is there a way (function perhaps) to get the count of the searchPanes or to see if any searchPanes exists so that if it doesn't exist I can disable the button that shows it.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586
    Answer ✓

    I'm not sure if you're aware, but you can have SearchPanes automatically open collapsed - something like this: http://live.datatables.net/cipohori/1/edit

    That said, if you want to know how many panes are visible, you can use :smile:

    $('div.dtsp-searchPane:visible').length
    

    Colin

  • wallabe123wallabe123 Posts: 23Questions: 12Answers: 0

    Awesome, thank you :)

Sign In or Register to comment.