Skip to main content

toolbar

An array of icon objects which sets a toolbar with buttons for items

toolbar?: IShapeToolbarConfig[];

Example

const diagram = new dhx.Diagram("diagram_container", { 
type:"org",
select:true,
margin:{
y:65
},
toolbar:[{
id: "download",
content:"<i className='dxi dxi-download'></i>"
},
{
id: "info",
content:"<i className='dxi dxi-information-outline'></i>"
}]
});

Related sample: Diagram. Configuration. Per-shape toolbar

Each icon object can have the following properties:

  • id - (string) the id of the icon.
  • content - (string) the content of the icon. It can contain an HTML element with the name of the icon class.
  • check - (function) checks whether the icon should be applied to the item. The function takes an item object and returns true, if the icon will be rendered for this item.
  • css - (function) the function which returns the name(s) of CSS class(es) that should be applied to the item.