Hi,
I'm trying to render a flat Json obect into a tree like <ul> using jquery.
This is what the Json object looks like
[
{"FacetTypeId":1,"ProductId":22,"FacetName":"Gender","FacetSysName":"Gender","FacetTypeName":"Mens","FacetTypeSysName":"Mens"},
{"FacetTypeId":6,"ProductId":22,"FacetName":"Size","FacetSysName":"Size","FacetTypeName":"157","FacetTypeSysName":"157"},
{"FacetTypeId":7,"ProductId":22,"FacetName":"Size","FacetSysName":"Size","FacetTypeName":"158","FacetTypeSysName":"158"},
{"FacetTypeId":15,"ProductId":22,"FacetName":"Size","FacetSysName":"Year","FacetTypeName":"2008","FacetTypeSysName":"2008"}
]
I'd like to create a nested ul like this:
<ul>
<li>
Gender
<ul>
<li>Mens</li>
</ul>
</li>
<li>
Size
<ul>
<li>157</li>
<li>158</li>
</ul>
</li>
<li>
Year
<ul>
<li>2008</li>
</ul>
</li>
</ul>
Can anyone help point out the best way this could be achieved please?