Skip to main content

TreeCollection Methods of Toolbar

You can use the following TreeCollection methods of Suite 8:

NameDescription
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();