Class: module:argos/_SDataEditMixin

module:argos/_SDataEditMixin()

Enables SData for the Edit view. Extends the SDataDetail Mixin by providing functions for $template requests.

Constructor

new module:argos/_SDataEditMixin()

Mixes In:
Source:

Members

entry

Properties:
Name Type Description
The Object

saved SData response.

Source:

templateEntry

Properties:
Name Type Description
The Object

saved template SData response.

Source:

Methods

applyContext(templateEntry)

ApplyContext is called during processTemplateEntry and is intended as a hook for when you are inserting a new entry (not editing) and wish to apply values from context, ie, from a view in the history.

The cycle of a template values is (first to last, last being the one that overwrites all)

1. Set the values of the template SData response 2. Set any field defaults (the fields default property) 3. ApplyContext is called 4. If this.options.entry is defined, apply those values

Parameters:
Name Type Description
templateEntry
Source:

convertEntry(entry) → {Object}

Loops a given entry testing for SData date strings and converts them to javascript Date objects

Parameters:
Name Type Description
entry Object

SData entry

Source:
Returns:

Entry with actual Date objects

Type
Object

convertValues(values) → {Object}

Does the reverse of convertEntry in that it loops the payload being sent back to SData and converts Date objects into SData date strings

Parameters:
Name Type Description
values Object

Payload

Source:
Returns:

Entry with string dates

Type
Object

createTemplateRequest() → {Object}

Creates Sage.SData.Client.SDataTemplateResourceRequest instance and sets a number of known properties.

List of properties used this.property/this.options.property:

resourceKind, querySelect, queryInclude

Source:
Returns:

Sage.SData.Client.SDataTemplateResourceRequest instance.

Type
Object

onRequestTemplateFailure(response, o)

Handler when an error occurs while request data from the SData endpoint.

Parameters:
Name Type Description
response Object

The response object.

o Object

The options that were passed when creating the Ajax request.

Source:

onRequestTemplateSuccess(entry)

Handler when a request to SData is successful, calls processTemplateEntry

Parameters:
Name Type Description
entry Object

The SData response

Source:

processTemplateEntry(templateEntry)

Processes the returned SData template entry by saving it to this.templateEntry and applies the default values to fields by:

The cycle of a template values is (first to last, last being the one that overwrites all)

1. Set the values of the template SData response 2. Set any field defaults (the fields default property) 3. ApplyContext is called 4. If this.options.entry is defined, apply those values

Parameters:
Name Type Description
templateEntry Object

SData template entry

Source:

requestTemplate()

Initiates the SData request for the template (default values).

Source: