<table id=tree> <ul id="treeData" style="display: none;">
<c:forEach items="${nodes}" var="node">
<li id="${node.key}" title="${node.fullPath}">
${node.description}
</li>
</c:forEach>
</ul>
<colgroup>
<col width="100px"></col>
<col width="20px"></col>
</colgroup>
<thead>
<tr>
<th>Tree</th>
<th></th>
</tr> </thead>
<tbody></tbody>
</table>
<div id="treeData" style="display: none;">
<c:forEach items="${nodes}" var="node">
<span data-tree-key="${node.key}" data-tree-path="${node.fullPath}" data-tree-title="${node.tooltip}"></span> </c:forEach></div>
var treeDataFromHTML = function (div) { // TODO use ajax instead of embedded tree data in HTML var treeData = [], $sel = $(div); $.each($sel, function(i, o) { var category = {"key" : o.dataset.treeKey, "title" : o.dataset.treeTitle, "tooltip" : o.dataset.treePath}; treeData.push(category); }); return treeData;};