Class: EMLAttributeView

EMLAttributeView()

An EMLAttributeView displays the info about one attribute in a data object

Screenshot

Constructor

new EMLAttributeView()

Source:

Extends

  • Backbone.View

Members

className :string

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

events :Object

The events this view will listen to and the associated function to call.
Type:
  • Object
Source:

template :Underscore.template

The HTML template for an attribute
Type:
  • Underscore.template
Source:

Methods

hideValidation(e)

Hides validation errors on this view
Parameters:
Name Type Description
e Event The event that was triggered by the user
Source:

initialize(options)

Creates a new EMLAttributeView
Parameters:
Name Type Description
options Object A literal object with options to pass to the view
Properties
Name Type Attributes Default Description
model EMLAttribute <optional>
The EMLAttribute model to display. If none is provided, an empty EMLAttribute will be created.
isNew boolean <optional>
false Set to true if this is a new attribute
Source:

postRender()

After this view has been rendered, add the MeasurementTypeView and render the MeasurementScaleView
Source:

render() → {EMLAttributeView}

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

renderMeasurementTypeView()

Render and insert the MeasurementTypeView for this view. This is separated out into its own method so it can be called from `postRender()` which is called after the user switches to the EntityView tab for this attribute. We do this to avoid loading as many MeasurementTypeViews as there are Attributes which would get us rate limited by BioPortal because every MeasurementTypeView hits BioPortal's API on render.
Source:

showValidation()

Shows validation errors on this view
Source:

updateModel(e)

Updates the model with the new value from the DOM element that was changed.
Parameters:
Name Type Description
e Event The event that was triggered by the user
Source: