Button with Icon
Buttons enable the users to initiate an action - buttons with icons indicate this purpose pretty clearly. As follows:
Download | Edit | Success |
---|---|---|
Button (Icon) Properties
Property | Description |
---|---|
Icon Type | Choose from a list of available icons. Arrows (Top/Right/Bottom/Left), Download, Edit, Delete, Alert, and Success. [Note: To have "only" the icon displayed, clear the "Label" field.] |
Icon Size | Sets the size of the selected icon. |
Icon Color | Sets the color of the selected icon. |
Icon Gap | Space between the text on the button and the icon. |
Icon Placement (Left/Right) | Select the side to which the icon is placed with respect to the text. |
API Methods
setDisabled
Sets the Disabled flag for this component.
- Method
- Usage
setDisabled(readOnly: boolean): void
// Setting the Disabled to "true" renders the element as non-clickable
a8forms.IconButton("iconButtonId").setDisabled(true)
// Setting the Disabled to "false" enables the element to be clickable
a8forms.IconButton("iconButtonId").setDisabled(false)
setVisibility
Sets the Visibility flag for this component.
- Method
- Usage
setVisibility(visible: boolean): void
// Setting the visibility to "true" makes the element visible
a8forms.IconButton("iconButtonId").setVisibility(true)
// Setting the visibility to "false" makes the element invisible
a8forms.IconButton("iconButtonId").setVisibility(false)
setVisibilityCondition
Sets the visibility condition for this component.
- Method
- Usage
setVisibilityCondition(condition: string): void
// Sets a condition for changing the element's visibility status.
a8forms.IconButton("iconButtonId").setVisibilityCondition("1 === 1")
Event Handlers
Event handlers allow you to set triggers for various actions based on the fired events. They are as follows:
onClick
onClick
- Triggers an action, such as calling for a service or function when the widget is clicked.
Note: Disable (*checkbox) - Selecting this checkbox grays out the button, making it unavailable to click.