Class: DatabasesView

databases-view/js/databases-view. DatabasesView

<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
input jQuery

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
input jQuery

The input to mark

Source:

<abstract> disable(input)

Marks the given input as disabled

Parameters:
Name Type Description
input jQuery

The input to mark

Source:

<abstract> enable(input)

Marks the given input as enabled

Parameters:
Name Type Description
input jQuery

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
input jQuery

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

Type
module:databases-view/js/databases-view.DatabasesView

selectCategory(category, checked, selection)

Selects the category with the given name

Parameters:
Name Type Argument Description
category string
checked boolean

The new state of the category

selection string <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
data object

The identifying properties of the database

checked boolean

The new state of the database

selection string <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
input jQuery

The input to mark

Source:

updateSelectedDatabases()

Updates the selected databases collection with the state of the UI

Source:

Type Definitions

Category

Properties:
Name Type Description
filter module:databases-view/js/databases-view.DatabasesView~CategoryFilter

Filter describing the databases contained in the category

name string

The name of the category

displayName string

A different name which may be more suitable for display

className string

CSS classes to apply to the category when it is rendered

Source:

CategoryFilter(model) → {boolean}

Function that describes the databases that a category contains

Parameters:
Name Type Description
model Backbone.Model

The database model

Source:
Returns:

True if the database is in the category; false otherwise

Type
boolean

DatabasesViewOptions

Properties:
Name Type Argument Default Description
databasesCollection module:databases-view/js/databases-collection.DatabasesCollection

The resources that the view will display

selectedDatabasesCollection module:databases-view/js/databases-collection.DatabasesCollection

The currently selected resources

topLevelDisplayName string

The display name of the top level category

emptyMessage string <optional>
''

Message to display if there are no databases

childCategories Array.<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

listViewOptions module:databases-view/js/databases-view.DatabasesListViewOptions <optional>

Options used to create the list views

delayedSelection module: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

Source:

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
collection module:databases-view/js/databases-collection.DatabasesCollection

The collection of databases

Source:
Returns:

Array of resource identifiers representing the selection

Type
Array.<ResourceIdentifier>
Copyright 2015-2018 Micro Focus International plc. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
Documentation generated by JSDoc 3.5.5 on Fri Jun 22nd 15:21 2018 using the DocStrap template.