Here is the XML parser:
function parseFancytreeXml($xml) {
var children = [];
$xml.children("node").each(function() {
var $node = $(this),
subnodes = $node.children("children");
// Create Fancytree NodeData object from <node> element
children.push({
title: $node.children("title").text(),
expanded: $node.attr("expanded"),
folder: $node.attr("folder"),
key: $node.attr("key"),
lazy: $node.attr("lazy"),
tooltip: $node.attr("tooltip"),
checkbox: $node.attr("checkbox"),
children: subnodes.length ? parseFancytreeXml(subnodes) : null
});
});
return children;
}
The XML (not all of it as you really only need to see the NODE and the checkbox tag within it)
<children title="A list of things">
<node key="MPIU 124" checkbox="false" tooltip="Id: 124 | Created: 6/1/2018">
<title>
<a href='MaintenancePlanInUseDetail.pp?Id=124' STYLE='text-decoration:none; color : #000000;'>YM Electrical</a> (124) [Complete] | Device: <a href='Device.pp?DeviceId=7' STYLE='text-decoration:none; color : #000000;'>Van</a> (7)
</title>
<children>
<node folder="true" key="WorkOrder Folder In Use MP 124" checkbox="false" tooltip="">
<title>Work Orders (Qty: 1)</title>
<children>
<node key="Work Order 75" checkbox="false" tooltip="Id: 75">
<title>
<a href='WorkOrder.pp?WorkOrderId=75' STYLE='text-decoration:none; color : #000000;'>YM Electrical (75) | <font color=blue>Complete</font></a>
</title>
</node>
</children>
</node>
</children>
</node>
</children>
checkbox: $node.attr("checkbox"),
I decided just to send in unselectable: true on each lazy load item and that actually stops the user from selecting a lazy loaded checkbox even though it is showing up and that is ok.