Constructor
new module:caplin/control/basic/ImageControl(controlType)
Constructs a new
caplin.control.basic.ImageControl
with the specified arguments.
This is a basic control that is used to display an image and capture user gestures (when an appropriate handler is
configured). Typically, the ImageControl
uses stylers (e.g. module:caplin/element/styler/ClassStyler
)
to specify how the image appears to the user, and handlers to capture user interactions such as mouse movements and
clicks.
The image control configuration is set in rendererDefinitions.xml
.
Basic usage:
<control type="caplin.control.basic.ImageControl"/>
With this configuration, a default template is assigned:
<div><div></div></div>
To specify a custom template:
<control type="caplin.control.basic.ImageControl">
<![CDATA[<div><div></div></div>]]>
</control>
Optionally, a handler (e.g. module:caplin/element/handler/grid/ClearFilterHandler
) can be configured against
the control
<control type="caplin.control.basic.ImageControl">
<handler className="caplin.element.handler.grid.ClearFilterHandler"/>
</control>
Extends:
Parameters:
Name | Type | Description |
---|---|---|
controlType |
module:caplin/control/factory/ControlType | The control type (unused). |
Extends
Methods
-
addClass()
-
- Inherited From:
- See:
-
attachControlEventListener()
-
bind()
-
clear()
-
- Inherited From:
- See:
-
- caplin.control.Control#clear
-
clearState()
-
createHtml()
-
detachControlEventListener()
-
disable()
-
enable()
-
finalize()
-
flash()
-
- Inherited From:
- See:
-
focus()
-
- Inherited From:
- See:
-
getAttributes()
-
getElement() → {HTMLElement}
-
Gets the element associated with this control.
- Inherited From:
Returns:
the element associated with this control.- Type
- HTMLElement
-
getFlashDuration() → {number}
-
Gets the value of the flash duration.
- Inherited From:
Returns:
the value of the flash duration.- Type
- number
-
getId() → {integer}
-
Gets the numeric id of this control.
- Inherited From:
Returns:
The numeric id of this control.- Type
- integer
-
getInitialClassName()
-
getNumericFlashDirection(newValue, oldValue) → {string}
-
Determines the numeric flash direction of the new value relative to the old value. If either new or old value is not a number (for example, if either value is undefined) then the function returns an empty string.
Parameters:
Name Type Description newValue
number The new value. oldValue
number The old value. Returns:
'up', 'down' or 'flat' depending on whether the new value is respectively greater than, less than or equal to the old value.- Type
- string
-
getValue()
-
- Inherited From:
- See:
-
initialize()
-
isBound() → {boolean}
-
Indicates whether the control is bound to an HTML Element.
- Inherited From:
Returns:
true
if the control is bound to an HTML Element; otherwisefalse
.- Type
- boolean
-
isEnabled()
-
refresh()
-
- Inherited From:
- See:
-
removeClass()
-
removeFlash()
-
Removes the flash state from the control.
- Inherited From:
-
replaceClass()
-
select()
-
- Inherited From:
- See:
-
setAttribute(name, value)
-
Sets a control attribute.
Parameters:
Name Type Description name
string The name of the attribute to set. value
Variant The value to set. -
setDomAttribute(attributeName, attributeValue)
-
Sets the given HTML attribute value on of the underlying HTML element.
Parameters:
Name Type Description attributeName
string the HTML attribute name to be set. attributeValue
string the HTML attribute value to set. - Inherited From:
-
setDomClass(className)
-
Sets the DOM CSS classname of the underlying HTML element.
Parameters:
Name Type Description className
string the CSS class name to set. - Inherited From:
-
setDomParentClass(className)
-
Sets the DOM CSS classname of the underlying parent HTML element.
Parameters:
Name Type Description className
string the CSS class name to set. - Inherited From:
-
setDomStyle(styleName, styleValue)
-
Sets the given CSS style value on of the underlying HTML element.
Parameters:
Name Type Description styleName
string the CSS style name to be set. styleValue
string the CSS value to set. - Inherited From:
-
setDomValue()
-
- See:
-
- caplin.control.basic.BasicControl#setDomValue
-
setId(id)
-
Sets the id of this control.
Parameters:
Name Type Description id
integer the value of the id to set. - Inherited From:
-
setInitialClassName()
-
setStyle()
-
- Inherited From:
- See:
-
setTooltip(tooltip)
-
Sets the tooltip value for this control.
Parameters:
Name Type Description tooltip
string the tooltip value. - Inherited From:
-
setValue()
-
- Inherited From:
- See:
-
toString()
-
unbind()