PDA

View Full Version : Element & setBounds



alex1er
6 Feb 2007, 4:40 AM
Hi,

I've got a problem or a bug i don't know.

I have a YAHOO.ext.Element on a fieldset and another on a label.

The label is contained by the fieldset.

Both are absolute positionned ( with relative, the result is the same ).

When i set the bounds of the label with


getEl("labeId").setBounds ( 10, 10, 100, 20 )


I was hoping that the xy where from the top left corner of the fieldset but it's of the body. So i can't positionned my elements.

Is there a bug or an error from me?

Thanks

brian.moeskau
6 Feb 2007, 4:57 AM
setBounds is a convenience function that internally does setXY for you for positioning. From the docs for setXY:


Set the position of the element in page coordinates, regardless of how the element is positioned.
To position relative to a container, try using setTop() and/or setLeft() -- those simply set the CSS top and left values which I think should work as you expect.

alex1er
7 Feb 2007, 6:18 AM
thanks a lot.

It works fine.