Filter buttons

You can use all defined filter in designer as filters in web search in certain info area. Filter button functionality allows you to use all defined filter as buttons in Search header.

If you click a button the filter in the search is added automatically and executes the search immediately. Furthermore the Button text is displayed in bold. If you click the Clear button all filters are removed and all filter button texts are set to not bold.



Action Template “TE_SearchViewHeader_AddFilter”

This template calls the JS function “u8.TeLSI.Filters.SetFilter_Header_NEW”.

To use this action template in designer with a button this template has to be selected behind the button.



  • Function call “filter button”

    Attributes:

    FilterName - The name of an filter defined in Designer Configuration. This filter is added to search after pushing the filter button in web.

    ButtonName - The name of the button which calls the JavaScript function. This name is needed to set and unset the bold attribute to specific button if the filter is active.

    Header - Due to the fact that there can be more than 1 header on 1 page you have the possibility to assign in which header the filter button is used. In most cases this attribute is “0”.

    Syntax: u8.TeLSI.SetFilter_Header(FilterName[s],ButtonName[s],Header[i])

    Example:

    u8.TeLSI.SetFilter_Header("A1.MyTasks","TE_A1_MyTaskFilter",0)
  • Function call “clear button”

    To each filter button set you should provide a clear button which clears the assigned filter and set all filter button texts in web to not bold.

    Syntax: u8.TeLSI.SetFilter_Header("clear","clear",0)

Java Script function “SetFilter_Header”

SetFilter_Header: function(filterName, buttonName, x) {

    //get the number of headers on the page
    var sum_header = $u(".Header").length; 
        var header = sum_header - 2; 
        
    //get the number of filter buttons in the header ( -1 because of the clear button )
        var counter = $u(".Header")[header].getItems({ tag: "buttons" }).length;
        
    //clear button
        if(filterName == "clear"){
            $u(".SearchForm")[x].clear();
            $u(".SearchForm")[x].execute();
            for(var i = 0; i < counter-1; i++){
                $$($u(".Header")[header].getItems({ tag: "buttons" })[i].element).css("font-weight","");
            }
        }else{
            $u(".SearchForm")[x].addFilter(filterName);
            for(var i = 0; i < counter-1; i++){
                $$($u(".Header")[header].getItems({ tag: "buttons" })[i].element).css("font-weight","");
            }
            $$($u(".Header")[header].getItem(buttonName).element).css("font-weight","bold");
        }
    }

NewCommand

Action: Command - New

Query state aaction: CORE_C_CanNew_disabled

CORE_NewRecord_Close

Action: ExpandNew

Query state action: CORE_C_CanNew_disabled