开发者

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);
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜