Below is my object structure, I get the list of OrganizationVO from db. Could some one suggest how to convert this list to JSON format ?
class OrganizationVO {
String name;
int id;
String mgrName;
List<OrganizationVO> orgvo;
}
Below is the script and template code I am using to generate the nested list, I am able to see the nested hierarchy in the static form where the child nodes are displayed within the root node. Please suggest how to get the drill down effect of nested nodes and also use the data-filter option.
$(function () {
$("#template").tmpl(clientData).appendTo("#target");
});
<script type="text/x-jquery-tmpl" id="template">
<li data-theme="b" class="ui-btn ui-btn-icon-right ui-li ui-li-has-alt ui-btn-up-a">
<div class="ui-btn-inner ui-li ui-li-has-alt">
<div class="ui-btn-text">
<a href="#${organizationID}" class="ui-link-inherit">
<h3>
${organizationName}</h3>
</a>
{{if organizationList}}
<div>
<ul>
{{each(i, child) organizationList}}
<li>
{{tmpl(child) "#template" }}
</li>
{{/each}}
</ul>
</div>
{{/if}}
</div></div>
</li>
</script>
Please read the jQM docs on JSON and Creating Dynamic pages