viewType

widgetTemplate

Properties:

Name

Type

Description

The

Simplate

template used to render the view's main DOM element when the view is initialized.
This template includes loadingTemplate and validationSummaryTemplate.
The default template uses the following properties:
name description
----------------------------------------------------------------
id main container div id
title main container div title attr
cls additional class string added to the main container div
resourceKind set to data-resource-kind

Parameters:

activate()

Empties the activate method which prevents detection of refresh from transititioning.
External navigation (browser back/forward) never refreshes the edit view as it's always a terminal loop.
i.e. you never move "forward" from an edit view; you navigate to child editors, from which you always return.

createItem() → {Object}

Returns:

Entry/payload

Type

Object

createLayout() → {Array.<Object>}

Sets and returns the Edit view layout by following a standard for section and field:
The `this.layout` itself is an array of section objects where a section object is defined as such:
{
name: 'String', // Required. unique name for identification/customization purposes
title: 'String', // Required. Text shown in the section header
children: [], // Array of child row objects
}
A child row object has:
{
name: 'String', // Required. unique name for identification/customization purposes
property: 'String', // Optional. The property of the current entity to bind to
label: 'String', // Optional. Text shown in the label to the left of the property
type: 'String', // Required. The field type as registered with the FieldManager.
// Examples of type: 'text', 'decimal', 'date', 'lookup', 'select', 'duration'
'default': value // Optional. If defined the value will be set as the default "unmodified" value (not dirty).
}
All further properties are set by their respective type, please see the individual field for
its configurable options.

Returns:

Edit layout definition

Type

Array.<Object>

createToolLayout() → {Object}

Sets and returns the toolbar item layout definition, this method should be overriden in the view
so that you may define the views toolbar items.
By default it adds a save button bound to `this.save()` and cancel that fires `ReUI.back()`

getTools() → {Object}

Returns:

The toolbar layout

Type

Object

getValues(all) → {Object}

Retrieves the value from every field, skipping the ones excluded, and merges them into a
single payload with the key being the fields `property` attribute, taking into consideration `applyTo` if defined.
If all is passed as true, it also grabs hidden and unmodified (clean) values.

Parameters:

open()

Available Options:
horizontal: True if the transition is horizontal, False otherwise.
reverse: True if the transition is a reverse transition (right/down), False otherwise.
track: False if the transition should not be tracked in history, True otherwise.
update: False if the transition should not update title and back button, True otherwise.
scroll: False if the transition should not scroll to the top, True otherwise.

refresh()

Refresh first clears out any variables set to previous data.
The mode of the Edit view is set and determined via `this.options.insert`, and the views values are cleared.
Lastly it makes the appropiate data request:

setValues(values, initial)

Sets the given values by looping the fields and checking if the field property matches
a key in the passed values object (after considering a fields `applyTo`).
The value set is then passed the initial state, true for default/unmodified/clean and false
for dirty or altered.

Parameters:

Name

Type

Description

values

Object

data entry, or collection of key/values where key matches a fields property attribute