Damir
Damir

Reputation: 56249

Need help with div creation

I need to create something similar what we have in desktop app but it need to be on site.enter image description here

All theses panels are objects in Java with properties type, number and name. I have same objects in my array ( json format and I create array of objects with dojo.declare). How to create for one object this thing enter image description here

How to create this ? Can anybody help ?

Upvotes: 0

Views: 198

Answers (1)

Stephen Chung
Stephen Chung

Reputation: 14605

var container = dojo.create("div");

dojo.forEach(array, function(obj) {
    var wrapper = dojo.create("div", null, container);
    var topline = dojo.create("div", null, wrapper);
    var bottomline = dojo.create("div", {"class":"IDField"}, wrapper);
    var leftcell = dojo.create("div", {"class":"LetterField"}, topline);
    var rightcell = dojo.create("div", {"class":"NumField " + (obj.NumField === 0 ? "Gray" : "Yellow")}, topline);

    leftcell.innerText = obj.......
         :
         :
});

Upvotes: 2

Related Questions