[Dojo-interest] Using dojo.html.layout

Adrian Hall adrianhall at mirapoint.com
Fri Jan 26 07:58:45 MST 2007


Thanks for your comment.

 

Yes, I am saying that the div is created properly, but the css is not
applied.  The css definition is in a separate file, but that file is
included via a <link> reference before the scripts.

 

I am only doing one div right now.  I figured if I can make one div work, I
have a hope of making multiple divs work.  I can't even make one div work
:-(

 

-Adrian

 

  _____  

From: dojo-interest-bounces at dojotoolkit.org
[mailto:dojo-interest-bounces at dojotoolkit.org] On Behalf Of Yogesh Mujumdar
Sent: Thursday, January 25, 2007 8:48 PM
To: dojo-interest at dojotoolkit.org
Subject: Re: [Dojo-interest] Using dojo.html.layout

 

Are you saying that the div is created properly but the css is not applied?
In which case it not an issue with layout container right? Try putting the
css definition before the create widget script in the head. Also, if you are
creating multiple div's, i hope you are not assigning the same id for all ;)


On 1/26/07, Adrian Hall <adrianhall at mirapoint.com> wrote:

I'm really struggling with LayoutContainer, so any help is appreciated.

 

I'm trying to fit a number of <div> elements that I have created
programmatically into a layout such that resizing, hiding of specific div's,
etc. works.

 

My thought was

 

1.	Create a LayoutContainer 
2.	Programmatically create the div's 
3.	Use dojo.widget.createWidget("ContentPane", {layoutAlign: "top"}, d)
to create the widget
4.	Add the widget to the layout container
5.	Use CSS #myID selectors to set the style

 

var lc = dojo.widget.byId("layout");

var d = document.createElement("div");

d.id = "myId";

var wd = dojo.widget.createWidget("ContentPane", { layoutAlign: "top"; },
d);

lc.addChild(wd);

 

. with CSS

 

#myId {

            Background-color: red;

            Height: 24px;

}

 

Now, this should give me a 24px width red stripe at the top of the screen.
But it doesn't.  The div gets placed in the right place (according to the
DOM inspector) and the id is the right thing, but the size is wrong (0px
height), and there is no color, so it isn't picking up the CSS from the CSS
file.

 

Any ideas as to what I am doing wrong here?  Do I really need to specify the
style individually for each div using with (d.style) {}? 

 

Alternative - instead of using LayoutContainer, according to the manual, I
can use dojo.html.layout.  Does anyone have an example of how to do this?

 

Thanks is advance,

 

-Adrian

 


_______________________________________________
Dojo FAQ: http://dojo.jot.com/FAQ
Dojo Book: http://manual.dojotoolkit.org/DojoDotBook
<http://manual.dojotoolkit.org/DojoDotBookDojo-interest@dojotoolkit.org> 
Dojo-interest at dojotoolkit.org
http://dojotoolkit.org/mailman/listinfo/dojo-interest 






-- 
regards/Yogesh 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070126/d7416f89/attachment.html


More information about the Dojo-interest mailing list