Show div for every object in array
I am new to Dojo and I need help. I have JSON file and inside array objects ( with properties name, type, status ) and I need to show something like one div with this data for every object which is inside array. What widget to use ? How to achive this ? (if I have
{
"elements": [
{
"name": "a",
"type": "A",
"status": "active"
开发者_开发问答 },
{
"name": "b",
"type": "B",
"status": "reactive"
}
]
}
how to vizualize this ?)
Shouldn't it be something simple like:
dojo.forEach(jsonData.elements, function(element) {
dojo.create("div", { name:element.name, type:element.type, status:element.status }, containerDiv);
});
精彩评论