Anyway to know if filters are active in searchPane?

Anyway to know if filters are active in searchPane?

rtmanrtman Posts: 13Questions: 4Answers: 0

Hi,

So my use case is this, in a mobile scenario (potentially desktop too) I want to have the searchPane in a modal/popup. It is only visible when a user clicks the filter button and will take up the viewport space until closed.

The issue is this, when a user closes the searchPane modal, after some time has passed (or even right away) the user can forget that searchPane filters are applied as there is no visual indication. This will be confusing to the user as they will not know why they don't see all the table data, unless they are super familiar with the system.

Other filter systems I've used render a sort of tag list of the applied filters, you can click on each to remove that specific filter. It keeps the user connected to the applied filters and lets them quickly interact with them.

I realise searchPane doesn't have this right now, but is there anyway to check if searchPane filters are active or not? An event listener perhaps? Atleast I could put a visual indication on the filters button or some other alert to the user that filters are active.

Best,
Ryan

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 9,189Questions: 0Answers: 1,534
    Answer ✓

    Hi @rtman ,

    There are two options:

    1. searchPane just calls column().search(). So an easy way to tell if a search is implement is to call columns().search() when you close your modal and if any of the values in the array are non-blank then you know a filter is applied.
    2. check $('.pane li.selected').length when the modal is closed - that will give the count of selected items in the pane.

    Cheers,

    Colin

  • rtmanrtman Posts: 13Questions: 4Answers: 0

    Excellent, I will experiment with this. Thanks @colin

This discussion has been closed.