# XButton component

Xbutton is the UIExtension button component. It can be used to customize icon, define whether to show text, whether to disable/enable button, etc.

# Code examples

  1. Simple xbutton example:

  2. Force to show text in built-in toolbar component

  3. Customize icon-class

  4. Disable button

  5. Click event handler

  6. Use controller to handle click event

  7. Use controller directive

# API

# Xbutton object properties

Properties Description Type
disabled Button disabled status boolean
isVisible Button visibility status boolean

# Methods

Method Description Version
setText(text: String): void Set button text. It supports I18n entry. 7.0
setIconCls(cssClass: String): void Set icon's css-class of a button 7.0
disable(): void Disable button. The disabled icon will not respond to the click event 7.0
enable(): void Enable button. The enabled button will respond to the click event 7.0
show(): void Show the hidden button 7.0
hide(): void Hide the button 7.0
destroy(): void Destroy the button component 7.0

# Events

Name Description Sample Version
click Click button to trigger button.on('click', () => {}) 7.0