Gravatar for

Question by adharbert, Nov 26, 2014 1:56 PM

Edit facets through JavaScript

Hi, I'm trying to edit the facets on a search page during the page load. Due to how facets work, we had to group items into one facet type. So we need to programmatically go through them and change the text.

I am trying to find a way to grab them but any event I add seem to fire off before the facets are rendered. Would anyone know how to either override this or fire an event off after the facets load?


2 Replies
Gravatar for

Answer by Carl Bolduc, Nov 26, 2014 2:08 PM

Have a look at the source of our technical blog search page, here is the relevant code for your needs:

var myValueCaption = {  "" : "Developers",
                        "answers" : "Answers",
                        "BlogTech" : "Technical Blog"};
$("#search").coveo("init", {
    Facet : {
        valueCaption : myValueCaption
Gravatar for

Comment by olamothe, Nov 26, 2014 2:20 PM

Link to the docs regarding this option :

Gravatar for

Answer by Vincent Séguin, Nov 26, 2014 2:07 PM

Hi Andrew,

If you go there : The deferredQuerySuccess event gets fired when everything is rendered, you could try it.

Gravatar for

Comment by adharbert, Nov 26, 2014 2:30 PM

so I tried using afterComponentsInitialization and that fires off before the facets load. so not really sure what else to use.

Ask a question