Class: _SDataEditMixin

_SDataEditMixin()

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

Constructor

new _SDataEditMixin()

Source:
Requires:
  • module:argos.SData

Extends

Requires

  • module:argos.SData

Members

entry

Properties:
Name Type Description
The Object saved SData response.
Source:

queryInclude

Inherited From:
Source:

querySelect

Inherited From:
Source:

resourceKind

Inherited From:
Source:

resourcePredicate

Inherited From:
Source:

resourceProperty

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

formatRelatedQuery(entry, fmt, property) → {String}

Applies the entries property to a format string
Parameters:
Name Type Description
entry Object Data entry
fmt String Where expression to be formatted, `${0}` will be the extracted property.
property String Property name to extract from the entry, may be a path: `Address.City`.
Inherited From:
Source:
Returns:
Type
String

initModel()

Initializes the model instance that is return with the curernt view.
Overrides:
Source:

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: