Constructor
new SearchResultsView()
- Since:
- Source:
Extends
Members
className :string
The HTML classes to use for this view's element
Type:
- Source:
events :Object
The events this view will listen to and the associated function to
call.
Type:
- Source:
metricsModel :MetricsModel
The metrics model that will be passed to the search result view
Type:
- Since:
- Source:
noResultsTemplate :string
The HTML to display when no search results are found.
Type:
- Since:
- Source:
The SolrResults collection that fetches and parses the searches.
Type:
- Source:
tagName :string
The HTML tag to use for this view's element
Type:
- Source:
type :string
The type of View this is
Type:
- Source:
Methods
addResultCollection()
- Source:
addResultModel(searchResult)
Renders the given
SolrResult model inside this view.
Parameters:
- Source:
addResultView(view)
Adds a Search Result View to the page
Parameters:
- Source:
createSearchResultView()
Creates a Search Result View
- Source:
empty()
Removes all child elements from this view.
- Source:
loading()
Renders a skeleton of this view that communicates to the user that it
is loading.
- Source:
removeListeners()
- Source:
render()
Render the view.
- Source:
setSearchResults() → {SolrResults}
- Source:
Returns:
-
Type
-
SolrResults
setUpMetrics() → {MetricsModel}
Creates a new MetricsModel if the app is configured to display metrics.
Sets the metrics model on this view. The metrics model is used to
display views, citations, and downloads for each search result.
- Since:
- Source:
Returns:
-
Type
-
MetricsModel
showError(searchResults, response)
When there is an error fetching the search results, show an alert
message to the user.
Parameters:
Name |
Type |
Description |
searchResults |
SolrResults
|
The collection of search results |
response |
Object
|
The response from the server |
- Source:
showNoResults()
Shows a message when no search results have been found.
- Source:
startListening()
- Source:
updateMetrics() → {MetricsModel}
Updates the metrics model with the PIDs of the search results and
fetches the metrics.
- Since:
- Source:
Returns:
-
Type
-
MetricsModel