Toolbar methods overview
info
Use the parse()
method to manipulate data in Toolbar.
You can use the following Toolbar methods of Suite 8:
Name | Description |
---|---|
disable() | Disables and dims an item(s) of Toolbar |
enable() | Enables a disabled item(s) of Toolbar |
getSelected() | Returns an array with IDs of selected items |
getState() | Gets current values/states of controls |
hide() | Hides an item of Toolbar |
isDisabled() | Checks whether an item of Toolbar is disabled |
isSelected() | Checks whether a specified Toolbar item is selected |
paint() | Repaints Toolbar on a page |
select() | Selects a specified item of Toolbar |
setFocus() | Sets focus on an Input control by its ID |
setState() | Sets values/states of controls |
show() | Shows an item of Toolbar |
unselect() | Unselects a selected Toolbar item |
const editor = new dhx.DiagramEditor("editor_container", {
type: "default",
view: {
toolbar: true
}
});
// disables the "file" item
editor.toolbar.disable("$file");
// disables "file" and "scale" items
editor.toolbar.disable(["$file", "$scale"]);
// disables all items
editor.toolbar.disable();
TreeCollection methods overview
You can use the following TreeCollection methods of Suite 8:
Name | Description |
---|---|
add() | Adds an item to a component |
canCopy() | Checks whether it is possible to copy a control into some other control |
copy() | Adds a copy of an item and places it in the specified position |
eachChild() | Iterates through child items of a control |
eachParent() | Iterates through all the parent items (the immediate parent and its parent, etc until the parent is the component itself) |
exists() | Checks whether the specified item exists in the component |
filter() | Filters controls by some criteria |
forEach() | Iterates over all items of a tree collection |
getFilters() | Returns an object with the applied filters |
getId() | Gets the ID of an item |
getIndex() | Gets the current position of an item |
getItem() | Gets an item by its ID |
getItems() | Gets the child items of a control |
getLength() | Counts child items of a control |
getParent() | Gets the ID of the parent of the control |
getRoot() | Returns the ID of the master component |
haveItems() | Checks whether an item has children |
move() | Moves items to different positions |
refreshItems() | Refreshes child items of a control |
remove() | Removes an item |
removeAll() | Clears the component of all controls |
resetFilter() | Resets the active filters |
restoreOrder() | Restores the component to the state previous to sorting / filtering |
save() | Saves changes made in a tree collection to the server side |
serialize() | Serializes the component data into JSON, XML or CSV format |
sort() | Sorts controls according to some criteria |
update() | Changes an item |
const editor = new dhx.DiagramEditor("editor_container", {
type: "default",
view: {
toolbar: true
}
});
// removes all the toolbar items
editor.toolbar.data.removeAll();