How to override the LiveSearch html?

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

How to override the LiveSearch html?

Hello.

I want to set LiveSearch.templateString by defining a custom searchbox (see the code below).

But LiveSearch.templateString is not a member of  the SearchBox class. It is defined as a separate class, when creating SearchBox (see https://dev.alfresco.com/resource/docs/aikau-jsdoc/SearchBox.js.html).

Is there a way to set templateString of LIveSearch using an override of SearchBox??

Greetings,

Wybrand.

define(["dojo/_base/declare",
        "dojo/text!./templates/my-livesearch.html",
        "alfresco/header/SearchBox"],
       function (declare, template, SearchBox) {
         return declare([SearchBox],{
           postMixInProperties: function my_searchBox__postMixInProperties(){

// How to set LiveSearch.templateString since this is not a member of SearchBox??
} }); });

 

2 Replies
Highlighted
Master

Re: How to override the LiveSearch html?

Due to nesting, there is no way to set the templateString in LiveSearch. But you could override the postCreate of SearchBox to customise the nested LiveSearch widget after its creating - that is what I did in a project a few years ago.

Highlighted
Member II

Re: How to override the LiveSearch html?

Great idea. It worked.

 

Thx,

Wybrand.