Gravatar for

Question by jschjolberg, May 14, 2014 3:49 PM

Clear All Filters - JavaScript Search Framework

Hi - is there a way to call the method that clears all filters directly from JavaScript? I see that a x-box appears that allows you to do this when you select filters. Can I call the method that that box is using? Thanks!

2 Replies
Gravatar for

Answer by olamothe, May 14, 2014 3:53 PM

Yes. The "reset" method is public on the facet


You can do something like this :


If you wish to reset all Facet at once , call this instead :

Gravatar for

Comment by jschjolberg, May 14, 2014 5:03 PM

Thank you - that worked great. Is there documentation somewhere that lists all of the different coveo methods that are available to call?

Gravatar for

Comment by olamothe, May 14, 2014 5:07 PM

Yep, every "Components" should have a section called Public methods. Each of these are public, and thus, callable using the JQuery extension.

In the side menu on the left, you should see a drop down menu under component that list them all.

Also, don't forget to "accept" the answer, this should help other people that have the same problem finding a solution more easily :)

Gravatar for

Answer by abuteau, Jun 27, 2014 11:09 AM

Disclaimer : I'm a complete noob in JQuery.

Suppose I want to apply the clear all filters to a span/link on click.

This is my span:

<span class="pl-rightarrow">&nbsp;&nbsp; Clear All</span>

This is my function:

 $(document).ready(function () {
     $('.pl-rightarrow').click(function () {

Not working though. How could I achieve that ?


Gravatar for

Comment by abuteau, Jun 27, 2014 1:00 PM

Nevermind the "Coveo." was missing before the $ Thanks.

Ask a question