AMI Web Framework API > Class > Control


ami.Control

The basic AMI control
Implements: ami.IControl

Constructor


Control(parentnull, ownernull)
Parameters:
NameTypeDescriptionOptionalNullable
parent*the parent entity
owner*the owner entity

Methods


onReady() ->{$.Promise or $.Deferred or undefined}
Called when the control is ready to run

Returns:
A JQuery promise object, deferred object or nothing
Type: $.Promise or $.Deferred or undefined

onRemove() ->{$.Promise or $.Deferred or undefined}
Called when the control is removed

Returns:
A JQuery promise object, deferred object or nothing
Type: $.Promise or $.Deferred or undefined

patchId(id) ->{string}
Patches an HTML identifier

Parameters:
NameTypeDescriptionDefaultOptionalNullable
idstringthe not patched HTML identifier
Returns:
The patched HTML identifier
Type: string

replaceHTML(selector, twig, options) ->{$.Promise}
Puts a HTML or TWIG fragment to the given target, see method [formatTWIG]{@link #jsdoc_method_formatTWIG}

Parameters:
NameTypeDescriptionDefaultOptionalNullable
selectorstringthe target selector
twigstringthe TWIG fragment{}
optionsObject.<string, *>dictionary of optional parameters (context, dict, twigs){}
Returns:
A JQuery promise object
Type: $.Promise

prependHTML(selector, twig, options) ->{$.Promise}
Prepends a HTML or TWIG fragment to the given target, see method [formatTWIG]{@link #jsdoc_method_formatTWIG}

Parameters:
NameTypeDescriptionDefaultOptionalNullable
selectorstringthe target selector
twigstringthe TWIG fragment{}
optionsObject.<string, *>dictionary of optional parameters (context, dict, twigs){}
Returns:
A JQuery promise object
Type: $.Promise

appendHTML(selector, twig, options) ->{$.Promise}
Appends a HTML or TWIG fragment to the given target, see method [formatTWIG]{@link #jsdoc_method_formatTWIG}

Parameters:
NameTypeDescriptionDefaultOptionalNullable
selectorstringthe target selector
twigstringthe TWIG fragment{}
optionsObject.<string, *>dictionary of optional parameters (context, dict, twigs){}
Returns:
A JQuery promise object
Type: $.Promise

setupCtx(immutables, defaults, options) ->{Object.<string, *>}
Sets up the control's context

Parameters:
NameTypeDescriptionDefaultOptionalNullable
immutablesObject.<string, *>dictionary of immutable parameters in the control's context
defaultsObject.<string, *>dictionary of default values for optional parameters
optionsObject.<string, *>dictionary of values for optional parameters
Returns:
The resulting control's context
Type: Object.<string, *>

createControl(parentnull, control, params, options) ->{$.Promise}
Asynchronously creates a control

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
controlstringthe control name
paramsArray.<*>the control's parameters
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise

createControlInBody(parentnull, control, controlParams, controlOptions, options) ->{$.Promise}
Asynchronously creates a control in the body

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
controlstringthe control name
controlParamsArray.<*>the control's render method mandatory parameters
controlOptionsObject.<string, *>the control's render method optional parameters
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise

createControlInContainer(parentnull, control, controlParams, controlOptions, icon, title, options) ->{$.Promise}
Asynchronously creates a control in a container

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
controlstringthe control name
controlParamsArray.<*>the control's render method mandatory parameters
controlOptionsObject.<string, *>the control's render method optional parameters
iconstringthe icon
titlestringthe title
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise

createControlFromWebLink(parentnull, el, options) ->{$.Promise}
Asynchronously creates a control in a container from a WEB link

Parameters:
NameTypeDescriptionDefaultOptionalNullable
parent*the parent entity
elElementthe HTML element
optionsObject.<string, *>dictionary of optional parameters (context, cache){}
Returns:
A JQuery promise object
Type: $.Promise
Next
SubApp