Tree Views

The LemonEdge platform has a standard tree view for all hierarchical items in the system. This ensures a rich consistent behaviour throughout, and provides the same functionality across all our client platforms.

Standard Features

The tree view, as with all views, obeys the permissions you are currently running under. If you do not have permissions to edit, delete or create entities you won't be able to in the tree view either - or it will throw an error when you try to save your changes.

By default all items are loaded into a tree view at once, and you can expand/collapse tree nodes as required. Some tree views are designed to load child data when nodes are expanded and so expanded the entire tree at once is disabled.

Standard Display

When a tree is displaying items by default it only includes two pieces of information:

  • An icon indicating the type of node. Most tree views won't have this depending on the client and heirarchical data being displayed (if the data is all the same type, then no icon is required).
  • The header, or title, of the item being displayed by that node.

Whenever a tree view is included in the system they always have an associated child view that display editable properties and data about the selected tree node.

This view displays like any other child view, and changes it data displayed reacting to the selection of the current tree node.

This allows an easy, consistent and intuitive way of editing the associated data for each node in the tree. If the data updates the header or icon of the node this will be instantly reflected in the tree itself.


Standard Commands

Tree views come for certain pre-defined system views, or can be explicitly created in code using our API. In either case, when creating a tree view you only have to specify the hierarchical relationship, label and icon and the system automatically handles everything else, including the following standard behaviour:

  • Expand/Collapse
    If you have selected a node this will expand (or collapse) that node and all child nodes beneath it.
    If you have no node selected it will expand, or collapse, the entire tree.
  • Clear
    If you have a node in the tree view selected this will clear its selection and leave no node being currently selected.
    This is useful in order to create a new node at the root/top level of the tree itself.
  • Open
    If you have permissions, and the node is an item that can be opened and displayed in its own view, you can open the selected node for a more detailed view. 
  • New
    If you have permissions you can create a new item in this tree. If you have currently got a node in the tree view selected then this new item will be created as a child of the existing selected node. If you don't have a node in the tree view selected then this new item will be created as a top level node at the root of the tree.
  • Copy
    If you have permissions to create a new item the system will copy everything about the current selected row, and create a new one with the same values for you. If you have currently got a node in the tree view selected then this new item will be created as a child of the existing selected node. If you don't have a node in the tree view selected then this new item will be created as a top level node at the root of the tree.
  • Delete
    If you have permission the system will allow you to delete the currently selected node in the tree view. You will be asked for confirmation and if this selected node has any child nodes beneath it they will automatically be deleted too.
  • Switch Parent
    If you have permissions, the data structure allows it, and the currently selected item is a child of a parent node in the tree this command allows you to switch its parent item to another node or to the root of the tree itself.
  • Move Up/Down
    If these entities are ordered in a sequential manner you can move items up/down throughout the tree. This movement will be contained to within the parent node the item is a child of. In the case of an item with no parent you will be moving it up/down within the root of the tree itself.
  • All data can always be exported to excel (or csv). The data is exported in a format that allows easy editing of the data to re-import your changes back into the system. See our Export Template for more information, but essentially this means any data you export is automatically in a format where you can easily modify it and import the changes back into the system.
    If running on the Windows application you can also choose filters to apply before exporting the data and which columns (including ones not on the grid) to include/exclude.