Class: DataItemView

DataItemView()

A DataItemView represents a single data item in a data package as a single row of a nested table. An item may represent a metadata object (as a folder), or a data object described by the metadata (as a file). Every metadata DataItemView has a resource map associated with it that describes the relationships between the aggregated metadata and data objects.

Constructor

new DataItemView()

Source:

Methods

emptyName()

Clears the text in the cell if the text was the default. We add an 'empty' class, and remove it when the user focuses back out.
Source:

handleReplace(event:)

Handle the user's click of the Replace item in the DataItemView dropdown. Triggers replaceFile after some basic validation. Called indirectly via the "click" event on elements with the class .replaceFile. See this View's events map.
Parameters:
Name Type Description
event: MouseEvent Browser Click event
Source:

replaceFile()

Replace a file (DataONEObject) in the collection with another one from a file picker. Maintains attributes on the original DataONEObject and maintains the entity information in the parent collection's metadata record (i.e., keeps your attributes, etc.). Called indirectly via the "change" event on elements with the class .file-upload. See this View's events map. The bulk of the work is done in a try-catch block to catch mistakes that would cause the editor to get into a broken state. On error, we attempt to return the editor back to its pre-replace state.
Parameters:
Type Description
Event
Source:

updateName(e)

Update the folder name based on the scimeta title
Parameters:
Name Type Description
e The event triggering this method
Source: