Gravatar for mark.angus@sitesystems.ca

Question by mark, Feb 4, 2015 1:34 PM

How to patch the method Coveo.Ui.FacetValues.prototype.sortValuesDependingOnStatus to add custom logic.

Hi, I would like to patch the method Coveo.Ui.FacetValues.prototype.sortValuesDependingOnStatus to add some custom logic. How would I go about doing this?

Thanks.

1 Reply
Gravatar for mlaporte@coveo.com

Answer by Martin Laporte, Feb 5, 2015 3:39 AM

Can you describe what result you're after in more details? Patching methods is only a last resort temporary measure, as it's very likely it'll break if you update the library at some point.

Gravatar for mark.angus@sitesystems.ca

Comment by mark, Feb 5, 2015 8:34 AM

Hi, thanks for the update. I am trying to custom sort the facet values. Occurrences and labels aren't enough options for my specific requirements.

Thanks,

Mark

Gravatar for mlaporte@coveo.com

Comment by Martin Laporte, Feb 5, 2015 8:35 AM

Take a look at the data-custom-sort option. You can use it to specify an explicit sort order.

Gravatar for mark.angus@sitesystems.ca

Comment by mark, Feb 5, 2015 12:27 PM

Hi, thanks that worked great!

Ask a question