See Also

Enumerations

Name Values
This class exposes no enumerations.

Constants

Name Value
This class exposes no constants.

Events

Definition Description
ContextClick( theItem as GraffitiWebTreeItem, mouseX as Integer, mouseY as Integer ) Fires when the user right-clicks an item in the display. mouseX and mouseY are relative to the page, not the control.
ItemChecked( theItem as GraffitiWebTreeItem ) Fires when the user checks an item in the display.
ItemClicked( theItem as GraffitiWebTreeItem ) Fires when the user has clicked an item.
ItemCollapsed( theItem as GraffitiWebTreeItem ) Fires when the user has collapsed an expandable item.
ItemDoubleClicked( theItem as GraffitiWebTreeItem ) Fires when the user has double-clicked an item.
ItemEdited( theItem as GraffitiWebTreeItem ) Fires when the user has finished editing an item.
ItemExpanded( theItem as GraffitiWebTreeItem ) Fires when the user has expanded an item.
ItemIconClicked( theItem as GraffitiWebTreeItem ) Fires when the user has clicked the icon of an item.
ItemSelected( theItem as GraffitiWebTreeItem ) Fires when the user selects an item either with the mouse or keyboard.

Methods

Definition Description
AddItem( theItem as GraffitiWebTreeItem, theParent as GraffitiWebTreeItem = Nil, AddToParentItem as Boolean = True ) Adds an item to the tree. If theParent is Nil, then it is added as a top-level node. AddToParent = True will add it to the Children property of the parent item (mostly for internal use).
CheckItem( theItem as GraffitiWebTreeItem, theValue as Boolean = True ) Sets the item's checkbox value to theValue.
CollapseAll() Collapse all currently expanded items.
CollapseItem( theItem as GraffitiWebTreeItem ) Collapses the supplied item.
DeselectAll() Deselect all items.
DisableItem( theItem as GraffitiWebTreeItem ) Disables an item, making it uncheckable.
EditItem( theItem as GraffitiWebTreeItem ) Makes an item editable.
EditItemEnd( theItem as GraffitiWebTreeItem ) Ends editing of an item.
EnableItem( theItem as GraffitiWebTreeItem ) Enables an item, making it checkable.
ExpandAll() Expands all currently expandable items.
ExpandItem( theItem as GraffitiWebTreeItem ) Expands the supplied item.
FindItem( itemText as String ) as GraffitiWebTreeItem Finds the first item whose Caption matches itemText.
GetDepth( theItem as GraffitiWebTreeItem ) as Integer Returns the level depth of the current item. Top-level items will be 1, their children will be 2, etc.
GetIndexOf( theItem as GraffitiWebTreeItem ) as Integer Gets the index of the supplied item within its parent's Children array, or within the Items array if top-level.
GetIndexPath( theItem as GraffitiWebTreeItem, Separator as String = “/” ) as String Returns an index path to the current item. As an example, calling GetIndexPath( myItem, “/” ) will return something like “3/7/1”.
GetPath( theItem as GraffitiWebTreeItem, Separator as String = “/” ) as String Returns the path to the current item using item captions. As an example, calling GetPath( myItem, “/” ) will return something like “Parent1/Parent2/Parent3/MyItem”.
HasChildren( theItem as GraffitiWebTreeItem ) as Boolean Returns true if the supplied item has children.
InsertItem( theItem as GraffitiWebTreeItem, insertBefore as GraffitiWebTreeItem ) Inserts theItem before insertBefore.
IsChildOf( theItem as GraffitiWebTreeItem, theParent as GraffitiWebTreeItem ) as Boolean Returns true is theItem is a direct child of theParent.
IsFirstChild( theItem as GraffitiWebTreeItem ) as Boolean Returns True if theItem is the first child in its parent.
IsLastChild( theItem as GraffitiWebTreeItem ) as Boolean Returns True if theItem is the last child of its parent.
IsSiblingOf( theItem as GraffitiWebTreeItem, theSibling as GraffitiWebTreeItem ) Returns True if the two supplied items are siblings.
IsTopLevel( theItem as GraffitiWebTreeItem ) as Boolean Returns True if theItem is a top-level item.
RemoveAll() Removes all items from the Tree.
RemoveItem( theItem as GraffitiWebTreeItem, includeChildren as Boolean = True ) Removes theItem from the tree. If includeChildren is False, then children of theItem are added to theItem's parent.
ScrollTo( theItem as GraffitiWebTreeItem ) Scrolls to theItem. If it is hidden under collapsed parents, those parents are expanded automatically.
SelectItem( theItem as GraffitiWebTreeItem ) Selects the specified item.
UpdateCaption( theItem as GraffitiWebTreeItem, newCaption as String ) Updates the specified item with newCaption.
UpdateIcon( theItem as GraffitiWebTreeItem, newIcon as String ) Updates the specified item with newIcon.
UpdateItemStyle( theItem as GraffitiWebTreeItem ) Updates the tree to show theItem.Style.

Properties

Name Type Default Value Description
AllowEdit Boolean False If True, users will be able to edit the contents of individual rows. NOTE: This property should only be set in the IDE's Inspector.
IconCheckbox String “” A FontAwesome icon string to use for an empty checkbox.
IconCheckboxChecked String “fa-checked-square-o” A FontAwesome icon string to use for checked checkboxes.
IconCheckboxUnknown String “fa-square-o” A FontAwesome icon string to use for checkboxes with an unknown value (IE: if some children, but not all, are selected).
IconExpanderClosed String “fa-caret-down” A FontAwesome icon string to use as an expander for items with children.
IconExpanderOpen String “fa-caret-right” A FontAwesome icon string to use as collapser for items with children.
IconStyle WebStyle Nil WebStyle to apply to icons in the tree.
Items() GraffitiWebTreeItem Nil Items in the tree, editing this directly is not recommended.
ItemSelStyle WebStyle Nil WebStyle to apply to selected items.
ItemStyle WebStyle Nil WebStyle to apply to all items.
LockUpdate Boolean False When true, rows added using AddItem will not update style information until LockUpdate is set to False. This should speed up addition of large amounts of rows.
RightToLeft Boolean False When true, the Tree will display in RTL fashion.
SelectedItem GraffitiWebTreeItem Nil The currently selected item.

Examples

Creating an Item with a FontAwesome Icon

GraffitiWebTree provides a constructor for creating items that have a FontAwesome icon to the left of the node's text.

dim firstItemFirstChild as new GraffitiWebTreeItem( "test child", "fas fa-times" )
firstItemFirstChild.Checkbox = True
me.AddItem( firstItemFirstChild, firstItem )
  • Last modified: 5 days ago
  • by agcyphers