Class: module:argos/Views/FileSelect

module:argos/Views/FileSelect()

File Select View is a view for selection files capabilities.

Constructor

new module:argos/Views/FileSelect()

Extends:
Source:

Extends

Members

app

A reference to the global App object

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

fileTemplate

Properties:
Name Type Description
fileTemplate Simplate
Source:

id

The id is used to uniquely define a view and is used in navigating, history and for HTML markup.

Properties:
Type Description
String
Overrides:
Source:

loadingTemplate

Properties:
Name Type Description
The Simplate

template used to render the loading message when the view is requesting more data.

The default template uses the following properties:

 name                description
 ----------------------------------------------------------------
 loadingText         The text to display while loading.
Source:

modelName

Registered model name to use.

Inherited From:
Source:

notSupportedTemplate

Properties:
Name Type Description
The Simplate

template that displays when HTML5 file api is not supported.

Source:

route

Properties:
Name Type Description
Route String

passed into the router. RegEx expressions are also accepted.

Inherited From:
Source:

security

May be defined along with Application hasAccessTo to incorporate View restrictions.

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

titleText

The titleText string will be applied to the top toolbar during show.

Overrides:
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)

Inherited From:
Source:

widgetTemplate

Properties:
Name Type Description
Simplate Simplate

that defines the HTML Markup

  • $ => File Select view instance
Source:

Methods

beforeTransitionAway()

Called before the view is transitioned (slide animation complete) away from.

Inherited From:
Source:

beforeTransitionTo()

Called before the view is transitioned (slide animation complete) to.

Inherited From:
Source:

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

createErrorHandlers() → {Array}

Inherited From:
Source:
Returns:

Returns an array of error handlers

Type
Array

createToolLayout() → {Object}

Returns the tool layout that defines all toolbar items for the view

Inherited From:
Source:
Returns:

The toolbar layout

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}

Returns the context of the view which is a small summary of key properties.

Inherited From:
Source:
Returns:

Vital View properties.

Type
Object

getErrorMessage()

Gets the general error message, or the error message for the status code.

Inherited From:
Source:

getFileItems() → {Array}

Returns an array of objects with the properties of: file, fileName, and description.

Source:
Returns:
Type
Array

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

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:

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:

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:

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:

onUpdateFailed()

Handles the display when the upload fails.

Source:

onUpdateProgress()

Handles the display when progress events are recieved.

Source:

onUploadFiles()

Handles the display when the user clicks upload.

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:

refresh()

Should refresh the view, such as but not limited to: Emptying nodes, requesting data, rendering new content

Inherited From:
Source:

refreshRequiredFor(options) → {Boolean}

Called in show() before route is invoked.

Parameters:
Name Type Description
options Object

Navigation options passed from the previous view.

Inherited From:
Source:
Returns:

True indicates view needs to be refreshed.

Type
Boolean

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()

Extends the @{link Sage.Platlform.Mobile.View} show to clear out the onchange event of the file input. The onchange event will only fire once per file, so we must re-insert the dom node and re-attach the event.

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

module:argos/Views/FileSelect()

new module:argos/Views/FileSelect()

Source:

Members

app

A reference to the global App object

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

fileTemplate

Properties:
Name Type Description
fileTemplate Simplate
Source:

id

The id is used to uniquely define a view and is used in navigating, history and for HTML markup.

Properties:
Type Description
String
Overrides:
Source:

loadingTemplate

Properties:
Name Type Description
The Simplate

template used to render the loading message when the view is requesting more data.

The default template uses the following properties:

 name                description
 ----------------------------------------------------------------
 loadingText         The text to display while loading.
Source:

modelName

Registered model name to use.

Inherited From:
Source:

notSupportedTemplate

Properties:
Name Type Description
The Simplate

template that displays when HTML5 file api is not supported.

Source:

route

Properties:
Name Type Description
Route String

passed into the router. RegEx expressions are also accepted.

Inherited From:
Source:

security

May be defined along with Application hasAccessTo to incorporate View restrictions.

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

titleText

The titleText string will be applied to the top toolbar during show.

Overrides:
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)

Inherited From:
Source:

widgetTemplate

Properties:
Name Type Description
Simplate Simplate

that defines the HTML Markup

  • $ => File Select view instance
Source:

Methods

beforeTransitionAway()

Called before the view is transitioned (slide animation complete) away from.

Inherited From:
Source:

beforeTransitionTo()

Called before the view is transitioned (slide animation complete) to.

Inherited From:
Source:

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

createErrorHandlers() → {Array}

Inherited From:
Source:
Returns:

Returns an array of error handlers

Type
Array

createToolLayout() → {Object}

Returns the tool layout that defines all toolbar items for the view

Inherited From:
Source:
Returns:

The toolbar layout

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}

Returns the context of the view which is a small summary of key properties.

Inherited From:
Source:
Returns:

Vital View properties.

Type
Object

getErrorMessage()

Gets the general error message, or the error message for the status code.

Inherited From:
Source:

getFileItems() → {Array}

Returns an array of objects with the properties of: file, fileName, and description.

Source:
Returns:
Type
Array

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

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:

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:

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:

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:

onUpdateFailed()

Handles the display when the upload fails.

Source:

onUpdateProgress()

Handles the display when progress events are recieved.

Source:

onUploadFiles()

Handles the display when the user clicks upload.

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:

refresh()

Should refresh the view, such as but not limited to: Emptying nodes, requesting data, rendering new content

Inherited From:
Source:

refreshRequiredFor(options) → {Boolean}

Called in show() before route is invoked.

Parameters:
Name Type Description
options Object

Navigation options passed from the previous view.

Inherited From:
Source:
Returns:

True indicates view needs to be refreshed.

Type
Boolean

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()

Extends the @{link Sage.Platlform.Mobile.View} show to clear out the onchange event of the file input. The onchange event will only fire once per file, so we must re-insert the dom node and re-attach the event.

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