Renders an interactive Treant.js hierarchical tree menu used for navigating and managing Axion package/block structures, with click navigation and drag-and-drop reorganisation.
Treemenu — set as ReportType in def_report.
def Render(self, Param1="", Param2="", Param3="") -> str:
Param1 — report code used in the left-click URL to load block content into the target container.
Param2 — CSS selector for the target container where block content is loaded (defaults to #body if empty).
Returns an HTML <div id="treemenu">, inline CSS, and a <script> block that initialise a Treant.js tree with click and drag-and-drop event listeners. Left-clicking a node loads its content into the target container via AJAX. Right-clicking opens an edit context menu. End-nodes accept drag-and-drop from draggable items. Returns an error message if no data is present.
setJS()Generates the full JavaScript block including Treant config, node declarations, and event listener setup.
setJSElements()Builds JavaScript variable declarations for all tree nodes using the query result.
setMenu()Returns JavaScript that adds click, dragover, and drop listeners to each node. Handles page-type-specific SQL commands for moving blocks between nodes.
setStyle()Returns inline CSS for tree node styling, selected-node highlight colour (from $theme-success$), and drag-and-drop styles.
Requires Treant.css, Treant.js, and raphael.js (loaded via the page, not add_resource). The query must return six columns per row: ParentGuid, ChildGuid, ChildName, Rank, Package, IsEndNode. Drag-and-drop calls textRun with commands such as sql_updatereportblock, sql_updateformblock, etc. depending on the dragged item type.