Login Register

div

Add button to div dynamically

I want to create a div dynamically and then create a dijit button and add it to the div.
I keep getting the error Node cannot be inserted at the specified point in the hierarchy" code: "3
Here is the code: What dumb thing am I overlooking?

//create the div
var fdiv= document.createElement("div");
fdiv.dojoType="dojo.dnd.Source";
fdiv.class="container";
fdiv.copyOnly="true";
fdiv.id="src1";
fdiv.jsId="c2";
document.body.appendChild(fdiv);

//create the button
var fparams = { label: "",
id: "but1",
showLabel: false
};

Storage of complex objects

I want to store a complex div-object together with all it's childnodes
via storage.put(Key,Value). Is this possible, if so how?

Dojo rocks!

Regards
R4DIUM

Always squared DIV in container DIV: dojo.style dimensions error in IE7

I've a container DIV that has its dimensions set in percentages:

#container { position:absolute; top:10%; left:20%; width:60%; height:80%; border:1px dashed #bbb; }

Syndicate content