Renders a hierarchical org-chart or structure tree using the Treant.js library, with right-click context menus and support for collapsible nodes.
Structuretree — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
Returns an HTML <div id="structuretree">, inline CSS, and a <script> block that initialise a Treant.js chart. The query must return nine columns per row: NodeDepth, ParentGuid, ChildGuid, ChildName, Rank, Package, Block, Items, Eventtype. Node depth is recalculated from the parent-child graph before rendering. Right-click on any node opens a context menu via treemenu_rightclickmenu().
setJS()Generates the full JavaScript initialisation block including config, node objects, and the Treant constructor call.
setJSElements()Builds the JavaScript variable declarations for each tree node, computing actual depth from the parent-child relationship.
setMenu()Attaches right-click contextmenu event listeners to each node element.
setStyle()Returns inline CSS for tree node styling and scroll behaviour.
setParentChild(eventguid, parchild, buildparents)Recursively resolves the ancestor chain for a given node GUID.
Options read from self._Options JSON:
sourcetype — data source type (default: Level)maxdepth — maximum tree depth to render; 0 means unlimitedformname — form name for context menu actionsallowbranching — whether branching is permitted (1 or 0)splitterbranching — splitter branching flagnode — Treant node options (e.g. collapsable, HTMLclass)connectors — Treant connector options (e.g. type)animation — Treant animation optionsrootOrientation — NORTH, SOUTH, EAST, or WESTnodeAlign — CENTER, TOP, or BOTTOMRequires Treant.css, Treant.js, and raphael.js.