Class Qww.Ctls.GlobalSearch.Mgr
JavaScript control to search across multiple fields (listboxes) within an application. Note that
you should create copies of the listboxes you wish to use which are utilised only by this control. For example if you are
already showing LBCOUNTRY as a listbox control on your page, create a copy of this listbox named LBCOUNTRY_SEARCH and use this
in conjunction with the Qww.Ctls.GlobalSearch.Mgr control.
Defined in: <JavaScript\QWW\QwwJs_GlobalSearchMgr.js>.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Constructs a new Qww.Ctls.GlobalSearch.Mgr instance.
|
| Field Attributes | Field Name and Description |
|---|---|
|
Reference to the configuration object which was used to create construct the object.
|
| Method Attributes | Method Name and Description |
|---|---|
|
Closes the results panel.
|
|
|
SetSearchText(txt)
Sets the text in the search box.
|
Class Detail
Qww.Ctls.GlobalSearch.Mgr(cfg)
Constructs a new Qww.Ctls.GlobalSearch.Mgr instance.
var objQvExSearchCtl1 = new Qww.Ctls.GlobalSearch.Mgr(
{
"Fields":[
new Qww.Ctls.GlobalSearch.Field(
{
ObjectID: "LBSEARCHACTORS",
Title: "Actors",
MatchText: "Were you looking for the following actors:",
NoMatchText: "No actors were found. Please refine your search",
MaxNumberOfLettersToShowInResult: 5,
MaxNumberOfResultsToShow: 7,
SelectAllText: "Select Them All!",
ReduceResultsText: "Change search text to reduce the results..."
}),
new Qww.Ctls.GlobalSearch.Field(
{
ObjectID: "LBSEARCHDIRECTOR",
Title: "Directors",
MatchText: "Were you looking for the following directors:",
NoMatchText: "No directors were found. Please refine your search",
MaxNumberOfLettersToShowInResult: -1,
MaxNumberOfResultsToShow: -1,
SelectAllText: "[Select All]",
ReduceResultsText: "lengthen search text to reduce results further..."
})
],
"ResultsElementId" : "QvExSearchCtl1_results",
"SearchTextBoxId" : "QvExSearchCtl1_txtSearch",
"Theme" : "",
"AutomaticallyClearSearchString" : true
});
<div id="ctl00_cphContent_QvExSearchCtl1" class="QwwJs_GlobalSearch-OuterDiv"
style="display:inline-block;width:150px;">
<input type="text" id="QvExSearchCtl1_txtSearch"
class="QwwJs_GlobalSearch-TextBox" style="width:100%;" />
<div class="QwwJs_GlobalSearch-SearchResults"
id="QvExSearchCtl1_results" style="z-index:100;position:absolute;display:none;">
</div>
</div>
- Parameters:
- {Object} cfg
- JSON object to configure Qww.Ctls.GlobalSearch.Mgr.
- {String} cfg.ResultsElementId
- Element to show search results in.
- {String} cfg.SearchTextBoxId
- ID of text box where search term is entered.
- {Qww.Ctls.GlobalSearch.Field[]} cfg.Fields
- Array of fields to search in the QlikView application.
- {String} cfg.Theme Optional, Default: Default
- Theme to use (this string gets used in css class names, for example QwwJs_GlobalSearch-NoMatchesFound-ThemeName).
- {Bool} cfg.AutomaticallyClearSearchString Optional, Default: false
- If set to true the search box is cleared whenever results are selected.
- {Bool} cfg.CloseSearch Optional, Default: false
- If set to true then each time the search command is sent to QlikView Server the search will also be 'closed' meaning that the matching listbox items will be selected (and any other QlikView objects will be updated accordingly).
- {Integer} cfg.SearchInterval Optional, Default: 500
- Rather than sending new search requests as soon as the user starts typing, the search control waits this amount of milliseconds after the last character was typed then sends the search.
- {Function} cfg.OnRenderResultsSection Optional
- Function to run to render custom results. Function will have the following signature: function(results, lbId, lbTitle, lbMatchString, lbNoMatchString, maxLengthOfMatchStringToShow, maxNumberOfResultsToShow, lbSelectAllText, lbReduceResultstext).
- {Function} cfg.OnInitialised Optional
- Function to call when the control has been initialised.
- {Function} cfg.OnRenderBegin Optional
- Function to call when the control is about to re-render.
- {Function} cfg.OnRenderComplete Optional
- Function to call when the control is about to complete rendering.
- {Function} cfg.OnBeforeCloseSearch Optional
- Function to call before the search results close. Should be of the form function(searchCtl, isFromCloseButton). The isFromCloseButton is false if the search is closing for a reason other than the [X] was clicked, for example when the user clears the search box text the search closes. If you return false from this function the closing of the search will be cancelled.
- {Function} cfg.OnSearchClosed Optional
- Function to call after the search results close. Should be of the form function(searchCtl, isFromCloseButton). The isFromCloseButton is false if the search is closing for a reason other than the [X] was clicked, for example when the user clears the search box text the search closes.
- {Function} cfg.OnGetSearchString|function(str){return "*" + str + "*";} Optional
- Function to call to return the search string to be sent to QlikView Server. Defaults to a 'standard' *search_string* pattern. NOTE this is only called when the str.length > 0, otherwise '***' will be sent as the search string to clear the search.
- {Function} cfg.OnSearchInitiated Optional
- Function to call when the search initiates. Useful, for example, to show an animated spinner to give the user immediate feedback that a search is in progress.
- {Function} cfg.OnSearchCompleted Optional
- Function to call after the search has completed. Useful, for example, to hide an animated spinner which has been shown on the OnSearchInitiated event.
- Returns:
- {Qww.Ctls.GlobalSearch.Mgr} Qww.Ctls.GlobalSearch.Mgr
Field Detail
{Object}
Cfg
Reference to the configuration object which was used to create construct the object. This
allows certain properties to be updated after initial instantiation.
Method Detail
CloseSearch()
Closes the results panel.
SetSearchText(txt)
Sets the text in the search box.
- Parameters:
- {String} txt
- Text to set.
