cancel
Showing results for 
Search instead for 
Did you mean: 

How to override the LiveSearch html?

wybrand
Champ in-the-making
Champ in-the-making

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 2

afaust
Legendary Innovator
Legendary Innovator

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.

wybrand
Champ in-the-making
Champ in-the-making

Great idea. It worked.

Thx,

Wybrand.