ImageButton

This is a button with an image. Unlike Button, it does not have a text label, but can also have a badge with a number and can be two state.

Related sample:  Toolbar. Image Button

Adding ImageButton

ImageButton can be easily added to a toolbar with the help of the add() method of Tree Collection:

toolbar.data.add({
    type: "imageButton",
    count: 10,
    src: "../img/avatar.png"
});

Attributes

You can provide the following attributes in the configuration object of an imageButton:

Working with ImageButton

Just like Button, imageButton can be hidden, disabled and can have a tooltip. You can also manipulate the states of a two state imageButton.

Check the full list of available operations in the Toolbar API and Tree Collection API.

Back to top