new SearchViewDescriptionBuilder(template)
Builds a module:searchmenu.SearchViewDescription, which describes a part of the search menu called "view".
Examples for views are: results, details, filters, filter options. There might be more in future.
The description contains the id's of the html elements, that will be used as "binding", to add elements like results. The "viewElementId" is the main parent (may be a "div" tag) of all view elements, that contains the "listParentElementId", which is the parent of the list entries (may be a "ul" tag).
The text content of each entry is described by the text templates.
Furthermore, the css style class can be given as a template, so search result field values can be used as a part of the style class.
Parameters:
Name | Type | Description |
---|---|---|
template |
module:searchmenu.SearchViewDescription | optional parameter that contains a template to clone |
- Source:
Members
(protected) description :module:searchmenu.SearchViewDescription
Type:
- Source:
Methods
build() → {module:searchmenu.SearchViewDescription}
Finishes the build of the description and returns its final (meant to be immutable) object.
- Source:
Returns:
isSelectableFilterOption(valueopt) → {module:searchmenu.SearchViewDescriptionBuilder}
Specifies, if the list entry can be selected as filter option.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
boolean |
<optional> |
false | if a list entry is selectable as filter option |
- Source:
Returns:
listEntryElementIdPrefix(value) → {module:searchmenu.SearchViewDescriptionBuilder}
ID prefix (followed by "--" and the index number) for every list entry.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | ID prefix for every list entry element |
- Source:
Returns:
listEntryElementTag(valueopt) → {module:searchmenu.SearchViewDescriptionBuilder}
Element tag for list entries.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
string |
<optional> |
"li" | tag for every list entry element |
- Source:
Returns:
listEntryStyleClassTemplate(valueopt) → {module:searchmenu.SearchViewDescriptionBuilder}
Template for the style classes of each list entry. May contain variables in double curly brackets. To use the property values of this view, prefix them with "view", e.g.: "{{view.listEntryElementIdPrefix}}".
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
string |
<optional> |
"{{view.listEntryElementIdPrefix}} {{category}}" | list entry style classes template |
- Source:
Returns:
listEntrySummaryTemplate(valueopt) → {module:searchmenu.SearchViewDescriptionBuilder}
Template for the text of each list entry, if the data group "summary" exists. May contain variables in double curly brackets.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
string |
<optional> |
"{{summaries[0].displayName}}: {{summaries[0].value}}" | list entry text template when there is a summary data group |
- Source:
Returns:
listEntryTextTemplate(valueopt) → {module:searchmenu.SearchViewDescriptionBuilder}
Template for the text of each list entry. May contain variables in double curly brackets.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
value |
string |
<optional> |
"{{displayName}}: {{value}}" | list entry text template when there is no summary data group |
- Source:
Returns:
listParentElementId(value) → {module:searchmenu.SearchViewDescriptionBuilder}
ID of the element (e.g. "ul"), that contains all list entries and is located inside the view.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | parent element ID |
- Source:
Returns:
viewElementId(value) → {module:searchmenu.SearchViewDescriptionBuilder}
ID of the element (e.g. "div"), that contains the view with all list elements and their parent.
Parameters:
Name | Type | Description |
---|---|---|
value |
string | view element ID. |
- Source: