<abstract> new DatabasesView(options)
View for showing and selecting HP Haven OnDemand resources. This is an abstract class and must be supplied
with templates for databases and categories. In addition, six primitive operations must be implemented:
- check
- uncheck
- enable
- disable
- determinate
- indeterminate
The selected databases collection will be kept up to date with the state of the UI, and changes made to the collection
will be reflected in the view.
Parameters:
| Name | Type | Description |
|---|---|---|
options |
module:databases-view/js/databases-view.DatabasesView~DatabasesViewOptions | The options for the view |
- Source:
Extends
- Backbone.View
Methods
-
<abstract> categoryTemplate()
-
Template for a category. The element which will respond to user interaction must have
class database-input. The name of the category must be in a data-category-id attribute. There must be an
element with class child-categories if child categories are used.- Source:
-
<abstract> check(input)
-
Marks the given input as selected
Parameters:
Name Type Description inputjQuery The input to mark
- Source:
-
<abstract> databaseTemplate()
-
Template for an individual database. The element which will respond to user interaction must have
class database-input.- Source:
-
<abstract> determinate(input)
-
Marks the given input as determinate
Parameters:
Name Type Description inputjQuery The input to mark
- Source:
-
<abstract> disable(input)
-
Marks the given input as disabled
Parameters:
Name Type Description inputjQuery The input to mark
- Source:
-
<abstract> enable(input)
-
Marks the given input as enabled
Parameters:
Name Type Description inputjQuery The input to mark
- Source:
-
getTemplateOptions() → {object}
-
Returns any parameters required for use in the template. This allows custom templates to take custom parameters
- Source:
Returns:
The parameters
- Type
- object
-
<abstract> indeterminate(input)
-
Marks the given input as indeterminate
Parameters:
Name Type Description inputjQuery The input to mark
- Source:
-
<abstract> initializeInputs()
-
Perform any initialization required for the database and category inputs to become functional
- Source:
-
render() → {module:databases-view/js/databases-view.DatabasesView}
-
Renders the view
- Source:
Returns:
this
-
selectCategory(category, checked, selection)
-
Selects the category with the given name
Parameters:
Name Type Argument Description categorystring checkedboolean The new state of the category
selectionstring <optional>
The name of theselection array to update. Defaults to 'currentSelection'
- Source:
-
selectDatabase(data, checked, selection)
-
Selects the database with the given id
Parameters:
Name Type Argument Description dataobject The identifying properties of the database
checkedboolean The new state of the database
selectionstring <optional>
The name of the selection array to update. Defaults to 'currentSelection'
- Source:
-
template()
-
Template for the view. If overriding it should have an element with class databases-list. For empty
message support add an element with class no-active databases- Source:
-
<abstract> uncheck(input)
-
Marks the given input as deselected
Parameters:
Name Type Description inputjQuery The input to mark
- Source:
-
updateSelectedDatabases()
-
Updates the selected databases collection with the state of the UI
- Source:
Type Definitions
-
Category
-
- Source:
Properties:
Name Type Description filtermodule:databases-view/js/databases-view.DatabasesView~CategoryFilter Filter describing the databases contained in the category
namestring The name of the category
displayNamestring A different name which may be more suitable for display
classNamestring CSS classes to apply to the category when it is rendered
-
CategoryFilter(model) → {boolean}
-
Function that describes the databases that a category contains
Parameters:
Name Type Description modelBackbone.Model The database model
- Source:
Returns:
True if the database is in the category; false otherwise
- Type
- boolean
-
DatabasesViewOptions
-
- Source:
Properties:
Name Type Argument Default Description databasesCollectionmodule:databases-view/js/databases-collection.DatabasesCollection The resources that the view will display
selectedDatabasesCollectionmodule:databases-view/js/databases-collection.DatabasesCollection The currently selected resources
topLevelDisplayNamestring The display name of the top level category
emptyMessagestring <optional>
'' Message to display if there are no databases
childCategoriesArray.<module:databases-view/js/databases-view.DatabasesView~Category> <optional>
The categories the databases will be placed in. If undefined all the databases will be in a single category
listViewOptionsmodule:databases-view/js/databases-view.DatabasesListViewOptions <optional>
Options used to create the list views
delayedSelectionmodule:databases-view/js/databases-view.DatabasesView~DelayedSelection <optional>
The databases collection may be empty when the view is created. This function specifies a selection to choose when databases are available
-
DelayedSelection(collection) → {Array.<ResourceIdentifier>}
-
The databases collection may be empty when the view is created. This function specifies a selection to choose when databases are available
Parameters:
Name Type Description collectionmodule:databases-view/js/databases-collection.DatabasesCollection The collection of databases
- Source:
Returns:
Array of resource identifiers representing the selection
- Type
- Array.<ResourceIdentifier>