PDA

View Full Version : which layout for a container with floating components



wawrek
23 Feb 2011, 6:40 AM
Hello,

I create a container which is containing a "mind map" filled with components positioned absolutely and having an x and y position. These components should logically have the "floating" config option set to true.

Does someone know which layout do I have to give to the container? the available ones (auto, card, fit, hbox, vbox) are not really designed to deal with floating components....
this is a simple container:


var container = new Ext.Container(
{
id : "workflowContainer",
autoDestroy : true,
scroll : 'both'
});


here is the code initializing the child:


var component = new Ext.Panel(
{
id:'div_'+i.data.id,
draggable:true,
width:200,
//floating : true, floatingCls : true,
style : {
position : 'absolute',
zIndex:'2000',
backgroundColor:'silver',
borderRadius:'10px',
left:i.data.left+"px",
top:i.data.top+"px"
},
listeners : {

The child component is a panel because it has a bunch of items.... For now I set up the "position : 'absolute'", top and left in the style option, but it is buggy on ipads. Anyway the way to go is to set "floating" to "true", but then it doesn't work... I don't know how to configure my container to deal with floating components..

any tip will be appreciated...

best,
wawrek

wawrek
25 Feb 2011, 4:15 AM
still no reply?
if you find a thread with a similar question, please post it.

joseeight
28 Feb 2011, 3:08 PM
You need to look at the "floating" config property to get the items to float.

wawrek
1 Mar 2011, 6:28 AM
I tried to do it with the "floating" config property set to "true". But then components show up off screen (container), somewhere around 0.0 with 0 as width and height...
i fixed it using "position : absolute" in styles, i also set their top, left positions in styles, i am not sure if it is the right way though.