access number of Filters Active
access number of Filters Active
montoyam
Posts: 568Questions: 136Answers: 5
in SearchPanes
at the top of a SearchPane there is a count of how many filters are selected. I can't find any documentation that shows how we can grab that count. Is it possible?
This question has an accepted answers - jump to answer
Answers
There isn't an API to get it, but you can count the rows with the classes like this:
Colin
That will work, as long as they only select one for each filter, which appears to be what the 'Filters Active' count at the top is doing anyway...I didn't realize that.
Thanks.
I am having trouble with the syntax for detecting when a filter item is clicked. I have tried the 'normal' ones but they don't work
Try:
Allan
Out of interest, why do you need to do that? I'm wondering if you might be better using
draw
on the main table.Allan
I have a select input and button that is going to do some record updates for the records that are showing. However, I need to make sure they have filtered the records using each of the three searchPane filters so they don't accidently update ALL the records in the dataset. So, I am disabling the button until they have selected 3 filter items.
Ah - very interesting. I was wondering if we should be triggering an event or making that kind of thing available through an API method. What we might look at doing is making an API method which exposes the DataTables that SearchPanes is using, then you can listen for events on them, etc.
Allan
this didn't seem to work either...
This one seems to work, see here:
thank you. I have decided instead to let the user click the update button, but stop/inform them if they did not have the correct number of filters. This way I don't have to clutter the page with any instructions.
But, thank you, as I'm sure i will use the .on(click) method in the future and it could benefit others.
And thank you Allan, for such an awesome product and your dedication to continually adding new functionality to it.
Thank you