AMI Web Framework API > Interface > IControl


ami.IControl

The AMI control interface

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