Spacer

This item takes space on the toolbar and is used for aligning controls.

Related sample:  Toolbar. Spacer

Adding Spacer

A new Spacer can be created with the help of the add() method of Tree Collection:

toolbar.data.add({
    type:"spacer"
});

Attributes

Spacer can have two attributes:

  • type - (string) the type of a control, set it to "spacer". If not specified - the "navItem" type is applied by default.
  • id - (string) the ID of a control, automatically generated if you do not set it

Showing/hiding spacer

You can hide and show Spacer with the show()/hide() methods of Toolbar:

toolbar.show(id);
toolbar.hide(id);

Related sample:  Toolbar. Hide/Show


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

Back to top