Class: _DetailBase

_DetailBase()

A Detail View represents a single record and should display all the info the user may need about the entry. A Detail entry is identified by its key (idProperty) which is how it requests the data via the endpoint.

Constructor

new _DetailBase()

Source:
Requires:
  • module:argos.Format
  • module:argos.Utility
  • module:argos.ErrorManager

Extends

Requires

  • module:argos.Format
  • module:argos.Utility
  • module:argos.ErrorManager

Members

_navigationOptions

Properties:
Name Type Description
Store Array.<Object> for mapping layout options to an index on the HTML node
Source:

actionPropertyTemplate

Properties:
Name Type Description
HTML Simplate that is used for detail layout items that fire an action, displayed with label and property value * `$` => detail layout row * `$$` => view instance
Source:

actionTemplate

Properties:
Name Type Description
HTML Simplate that is used for detail layout items that fire an action, displayed as an icon and text * `$` => detail layout row * `$$` => view instance
Source:

app

A reference to the globa App object
Inherited From:
Source:

attributeMap

Properties:
Name Type Description
Creates Object a setter map to html nodes, namely: * detailContent => contentNode's innerHTML
Overrides:
Source:

customizationSet

Properties:
Name Type Description
The String customization identifier for this class. When a customization is registered it is passed a path/identifier which is then matched to this property.
Source:

detailHeaderTemplate

Properties:
Name Type Description
HTML Simplate that creates the detail header displaying information about the tab list `$` => the view instance
Source:

detailsText

Properties:
Name Type Description
Helper String string for a basic section header text
Source:

editText

Deprecated:
  • Yes
Source:

editTooltipText

Properties:
Name Type Description
Text String shown in the top toolbar edit button
Source:

editView

Source:

emptyTemplate

Properties:
Name Type Description
HTML Simplate shown when no data is available.
Source:

entityText

Source:

entry

Properties:
Name Type Description
The Object data entry
Source:

errorHandlers

Properties:
Name Type Description
errorHandlers Array Array of objects that should contain a name string property, test function, and handle function.
Inherited From:
Source:

errorText

Properties:
Name Type Description
Localized Object error messages. One general error message, and messages by HTTP status code.
Inherited From:
Source:

expose

Properties:
Name Type Description
Controls Boolean if the view should be exposed
Source:

HTTP_STATUS

Properties:
Name Type Description
Http Object Error Status codes. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
Inherited From:
Source:

icon

Source:

id

Properties:
Name Type Description
The String unique identifier of the view
Overrides:
Source:

informationText

Source:

isRefreshing

Properties:
Name Type Description
Flag Boolean to signal that the interface is loading and clicking refresh will be ignored to prevent double entity loading
Source:

isTabbed

Properties:
Name Type Description
Controls Boolean whether the view will render as a tab view or the previous list view
Source:

layout

Properties:
Name Type Description
The Object layout definition that constructs the detail view with sections and rows
Source:

loadingTemplate

Properties:
Name Type Description
HTML Simplate shown when data is being loaded. `$` => the view instance
Source:

loadingText

Properties:
Name Type Description
Text String shown while loading and used in loadingTemplate
Source:

modelName

Registered model name to use.
Inherited From:
Source:

multiColumnClass

Properties:
Name Type Description
Determines String the SoHo class implemented in property templates
Source:

multiColumnCount

Properties:
Name Type Description
Determines Number how many columns the detail view property views should contain
Source:

notAvailableTemplate

Properties:
Name Type Description
HTML Simplate that is shown when not available `$` => the view instance
Source:

notAvailableText

Properties:
Name Type Description
Text String used in the notAvailableTemplate
Source:

propertyTemplate

Properties:
Name Type Description
HTML Simplate that is used for a property in the detail layout * `$` => detail layout row * `$$` => view instance
Source:

quickActionSection

Properties:
Name Type Description
Controls String how the view determines the quick action section by mapping this string with that on the detail view (should be overwritten)
Source:

quickActionTemplate

Properties:
Name Type Description
HTML Simplate that creates the quick action list
Source:

refreshTooltipText

Properties:
Name Type Description
Text String shown in the top toolbar refresh button
Source:

relatedPropertyTemplate

Properties:
Name Type Description
HTML Simplate that is used for detail layout items that point to related views, includes a label and links the value text * `$` => detail layout row * `$$` => view instance
Source:

relatedTemplate

Properties:
Name Type Description
HTML Simplate that is used for detail layout items that point to related views, displayed as an icon and text * `$` => detail layout row * `$$` => view instance
Source:

route

Properties:
Name Type Description
Route String passed into the router. RegEx expressions are also accepted.
Inherited From:
Source:

rowTemplate

Properties:
Name Type Description
HTML Simplate that is used for rows created with columns
Source:

sectionBeginTemplate

Properties:
Name Type Description
HTML Simplate that starts a new section `$` => the view instance
Source:

sectionEndTemplate

Properties:
Name Type Description
HTML Simplate that ends a section `$` => the view instance
Source:

security

Overrides:
Source:

serviceName

May be used to specify the service name to use for data requests. Setting false will force the use of the default service.
Properties:
Type Description
String/Boolean
Inherited From:
Source:

store

Properties:
Name Type Description
The Object dojo store this view will use for data exchange.
Source:

titleText

Overrides:
Source:

toggleCollapseClass

Properties:
Name Type Description
CSS String class for the collapse button when in a expanded state
Source:

toggleCollapseText

Properties:
Name Type Description
ARIA String label text for a collapsible section header
Source:

toggleExpandClass

Properties:
Name Type Description
CSS String class for the collapse button when in a collapsed state
Source:

tools

This views toolbar layout that defines all toolbar items in all toolbars.
Properties:
Type Description
Object
Inherited From:
Source:

viewType

View type (detail, edit, list, etc)
Overrides:
Source:

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. 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
Overrides:
Source:

Methods

activate(tag, data)

Extends the parent implementation to set the nav options title attribute to the descriptor
Parameters:
Name Type Description
tag
data
Source:

activateRelatedEntry(params)

Handler for the related entry action, navigates to the defined `data-view` passing the `data-context`.
Parameters:
Name Type Description
params Object Collection of `data-` attributes from the source node.
Source:

activateRelatedList(params)

Handler for the related list action, navigates to the defined `data-view` passing the `data-context`.
Parameters:
Name Type Description
params Object Collection of `data-` attributes from the source node.
Source:

beforeTransitionAway()

Called before the view is transitioned (slide animation complete) away from.
Inherited From:
Source:

beforeTransitionTo() → {Object}

Extends the parent implementation to also clear the view if `refreshRequired` is true
Overrides:
Source:
Returns:
View context object
Type
Object

buildRoute() → {String}

Show method calls this to build a route that it can navigate to. If you add a custom route, this should change to build a route that can match that.
Inherited From:
Source:
Returns:
Type
String

clear()

Clears the view by replacing the content with the empty template and emptying the stored row contexts.
Source:

createErrorHandlers() → {Array}

Overrides:
Source:
Returns:
Returns an array of error handlers
Type
Array

createLayout() → {Array.<Object>}

Sets and returns the Detail view layout by following a standard for section and rows: 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 list: boolean, // Optional. Default false. Controls if the group container for child rows should be a div (false) or ul (true) 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 onCreate: function(), // Optional. You may pass a function to be called when the row is added to the DOM include: boolean, // Optional. If false the row will not be included in the layout exclude: boolean, // Optional. If true the row will not be included in the layout template: Simplate, // Optional. Override the HTML Simplate used for rendering the value (not the row) where `$` is the row object tpl: Simplate, // Optional. Same as template. renderer: function(), // Optional. Pass a function that receives the current value and returns a value to be rendered encode: boolean, // Optional. If true it will encode HTML entities cls: 'String', // Optional. Additional CSS class string to be added to the row div use: Simplate, // Optional. Override the HTML Simplate used for rendering the row (not value) provider: function(entry, propertyName), // Optional. Function that accepts the data entry and the property name and returns the extracted value. By default simply extracts directly. value: Any // Optional. Provide a value directly instead of binding }
Source:
Returns:
Detail layout definition
Type
Array.<Object>

createStore() → {*}

CreateStore is the core of the data handling for Detail Views. By default it is empty but it should return a dojo store of your choosing. There are Mixins available for SData.
Source:
Returns:
Type
*

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.
Overrides:
Source:
Returns:
this.tools
Type
Object

expandExpression(expression) → {String}

Expands the passed expression if it is a function.
Parameters:
Name Type Description
expression String/Function Returns string directly, if function it is called and the result returned.
Inherited From:
Source:
Returns:
String expression.
Type
String

getContext() → {Object}

Extends the parent implementation to also set the resourceKind, key and descriptor
Overrides:
Source:
Returns:
View context object
Type
Object

getErrorMessage()

Gets the general error message, or the error message for the status code.
Inherited From:
Source:

getModel()

Returns a new instance of a model for the view.
Inherited From:
Source:

getOptionsContext() → {Object}

Returns the options used for the View getContext().
Inherited From:
Source:
Returns:
Options to be used for context.
Type
Object

getRoute()

Gets the route associated with this view. Returns this.id if no route is defined.
Inherited From:
Source:

getSecurity(access)

Returns the defined security.
Parameters:
Name Type Description
access
Inherited From:
Source:

getService() → {Object}

Returns the primary SDataService instance for the view.
Inherited From:
Source:
Returns:
The Sage.SData.Client.SDataService instance.
Type
Object

getTag() → {String}

Returns the view key
Source:
Returns:
View key
Type
String

getTools() → {Object}

Called from Applications view transition handler and returns the fully customized toolbar layout.
Inherited From:
Source:
Returns:
The toolbar layout
Type
Object

handleError(error)

Starts matching and executing errorHandlers.
Parameters:
Name Type Description
error Error Error to pass to the errorHandlers
Inherited From:
Source:

init()

Called on loading of the application.
Inherited From:
Source:

initConnects()

Establishes this views connections to various events
Inherited From:
Source:

initModel()

Initializes the model instance that is returned with the current view.
Inherited From:
Source:

invokeAction(name, parameters, evt, el)

Extends the mixins invokeAction to stop if `data-disableAction` is true
Parameters:
Name Type Description
name
parameters Object Collection of `data-` attributes from the node
evt Event
el HTMLElement
Source:

isDisabled() → {Boolean}

Returns true if view is disabled.
Inherited From:
Source:
Returns:
.
Type
Boolean

load()

Called once the first time the view is about to be transitioned to.
Inherited From:
Deprecated:
  • Yes
Source:
Navigates to the defined `this.editView` passing the current `this.entry` as default data.
Parameters:
Name Type Description
el HTMLElement
Source:
Navigates to a given view id passing the options retrieved using the slot index to `this._navigationOptions`.
Parameters:
Name Type Description
id String View id to go to
slot Number Index of the context to use in `this._navigationOptions`.
descriptor String Optional descriptor option that is mixed in.
Source:

onActivate(self)

The onActivate event.
Parameters:
Name Type Description
self
Inherited From:
Source:

onBeforeTransitionAway(self)

The onBeforeTransitionAway event.
Parameters:
Name Type Description
self
Inherited From:
Source:

onBeforeTransitionTo(self)

The onBeforeTransitionTo event.
Parameters:
Name Type Description
self
Inherited From:
Source:

onRefreshClicked()

Called when the user clicks the refresh toolbar button.
Source:

onShow(self)

The onShow event.
Parameters:
Name Type Description
self
Inherited From:
Source:

onToolLayoutCreated()

Called after toolBar layout is created;
Inherited From:
Source:

onTransitionAway(self)

The onTransitionAway event.
Parameters:
Name Type Description
self
Inherited From:
Source:

onTransitionTo(self)

The onTransitionTo event.
Parameters:
Name Type Description
self
Inherited From:
Source:

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.
Inherited From:
Source:

postCreate()

Extends the dijit widget postCreate to subscribe to the global `/app/refresh` event and clear the view.
Source:

preProcessEntry(entry) → {Object}

Parameters:
Name Type Description
entry Object Entry from data store
Source:
Returns:
By default does not do any processing
Type
Object

processEntry(entry)

Takes the entry from the data store, applies customization, applies any custom item process and then passes it to process layout.
Parameters:
Name Type Description
entry Object Entry from data store
Source:

processLayout(layout, entry)

Processes the given layout definition using the data entry response by rendering and inserting the HTML nodes and firing any onCreate events defined.
Parameters:
Name Type Description
layout Array.<Object> Layout definition
entry Object data response
Source:

refresh()

If a security breach is detected it sets the content to the notAvailableTemplate, otherwise it calls requestData which starts the process sequence.
Overrides:
Source:

refreshRequiredFor(options) → {Boolean}

Determines if the view should be refresh by inspecting and comparing the passed navigation option key with current key.
Parameters:
Name Type Description
options Object Passed navigation options.
Overrides:
Source:
Returns:
True if the view should be refreshed, false if not.
Type
Boolean

requestData()

Initiates the request.
Source:

routeLoad(ctx, next)

Fires first when a route is triggered. Any pre-loading should happen here.
Parameters:
Name Type Description
ctx Object
next function
Inherited From:
Source:

routeShow(ctx, next)

Fires second when a route is triggered. Any pre-loading should happen here.
Parameters:
Name Type Description
ctx Object
next function
Inherited From:
Source:

show(options, transitionOptions)

Shows the view using pagejs in order to transition to the new element.
Parameters:
Name Type Description
options Object The navigation options passed from the previous view.
transitionOptions Object Optional transition object that is forwarded to open.
Overrides:
Source:

toggleSection()

Toggles the collapsed state of the section.
Source:

transitionAway()

Called after the view has been transitioned (slide animation complete) away from.
Inherited From:
Source:

transitionTo()

Called after the view has been transitioned (slide animation complete) to.
Inherited From:
Source: