Iam trying to build a html from a json object . My json will be in the following structure .
[{"Property1":[{"IsDropDown":"true","Value":"Drp1Value1"},
{"IsDropDown":"true","Value":"Drp1Value2"},
{"IsDropDown":"false","Href":"Link1"}]},
{"Property2":[{"IsDropDown":"true","Value":"Drp2Value1"},
{"IsDropDown":"true","Value":"Drp2Value2"},
{"IsDropDown":"false","Href":"Link1"}]}]**
From this json I need to build 2 dropdowns by checking the property IsDropDown and 1 anchor link (IsDropDown == false) . Please keep in mind that propery object (Property1) is not fixed in length and even the nested object in Property is also not fixed . So i need one or more templates from which i can solve this.
From the above json output should be like 2 dropdowns first dropdown consisting of values Drp1Value1, DrpValue2 and second dropDown consisting of values Drp2Value1 and DrpValue2 . and if IsDropDown is false then build a anchor tag with href from the json object (No repetation should be allowed in From the above json 2 dropdown of 2 values each and a anchor tag sho.lud be built)
There is no way i can change the json structure because it is from a third party api . Is it possible with any of template frame works? i tried jTemplate and mustache.js but i was not able to do it .