Class: EMLMissingValueCodesView

EMLMissingValueCodesView()

An EMLMissingValueCodesView provides an editing interface for an EML Missing Value Codes collection. For each missing value code, the view provides two inputs, one of the code and one for the code explanation. Each missing value code can be removed from the collection by clicking the "Remove" button next to the code. A new row of inputs will automatically be added to the view when the user starts typing in the last row of inputs.

Screenshot

Constructor

new EMLMissingValueCodesView()

Since:
  • 2.26.0
Source:

Extends

  • Backbone.View

Members

className :string

The className to add to the view container
Type:
  • string
Source:

classes :Object

The classes to add to the HTML elements in this view
Type:
  • Object
Properties:
Name Type Description
title string The class to add to the title element
description string The class to add to the description paragraph element
notification string The class to add to the validation message container element
rows string The class to add to the container element for the missing value code rows
Source:

text :Object

User-facing text strings that will be displayed in this view.
Type:
  • Object
Properties:
Name Type Description
title string The title text for this view
description Array.<string> The description text for this view. Each string in the array will be rendered as a separate paragraph.
Source:

type :string

The type of View this is
Type:
  • string
Source:

Methods

addNewRow()

Add a new, empty Missing Value Code model to the collection. This will trigger the creation of a new row in the view.
Source:

addRow(model) → {EML211MissingValueCodeView}

Creates a new row view for a missing value code model and inserts it into this view at the end.
Parameters:
Name Type Description
model EMLMissingValueCode The model to create a row for
Source:
Returns:
The row view that was created
Type
EML211MissingValueCodeView

initialize(options)

Creates a new EMLMissingValueCodesView
Parameters:
Name Type Description
options Object A literal object with options to pass to the view
Properties
Name Type Attributes Description
collection EMLAttribute <optional>
The EMLMissingValueCodes collection to render in this view
Source:

modelIsNew(model) → {boolean}

Tests is a model should be considered "new" for the purposes of displaying it in the view. A "new" model is used to render a blank row in the view for entry of a new missing value code. We consider it new if it's the last in the collection and both attributes are blank.
Parameters:
Name Type Description
model EMLMissingValueCode The model to test
Source:
Returns:
Whether or not the model is new
Type
boolean

removeListeners()

Remove listeners that were previously set for this view
Source:

removeRow(model) → {EML211MissingValueCodeView}

Removes a row view from this view
Parameters:
Name Type Description
model EMLMissingValueCode The model to remove a row for
Source:
Returns:
The row view that was removed
Type
EML211MissingValueCodeView

render() → {EMLMissingValueCodesView}

Renders this view
Source:
Returns:
A reference to this view
Type
EMLMissingValueCodesView

renderRows()

Renders the rows for each missing value code in the collection, and adds a new row for entry of a new missing value code.
Source:

renderText()

Add the title, description, and placeholder for a validation message.
Source:

setListeners()

Set listeners required for this view
Source: