Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    top and left offsets ignored in layouts

    Greetings,

    I seem to have trouble understanding exactly how Hlayout and Vlayout work. What I'm trying to do is nest several layouts. I have a couple of Vlayouts and a couple of Hlayouts and I'm nesting them inside each other and then inside a larger Hlayout, which in turn is inside of a tab pane.

    The problem is that labels within the inner most Vlayout ignore top and left offsets. They simply place in the upper lefthand corner. And if I set canDragReposition:true on the label, it only works when it is not inside of a layout container. This is confusing to me, I would think I could position labels inside of a Vlayout or Hlayout, but I'm unable to. I think the problem is that I just don't understand in what situations the left and top offsets will be ignored on an object like a label. Can you help?

    Thanks,
    S

    #2
    If you use addMember to add a member to a Layout, it's coordinates are then managed by the Layout and top and left can no longer be set.

    You should see such components stacking horizontally or vertically; if you don't, then you've added the components as non-member children, not members, which means you are going to place and size them manually and they won't be included in the layout algorithm.

    If you want to create spacing between components in a layout, use layout.membersMargin, canvas.extraSpace, or just CSS margins or padding for specific situations where you want additional space.

    Comment


      #3
      Below is an example of how I'm doing it. How would I add components to a layout that are "non-member children"? I want the labels in the layout so I can show hide according to the parent.

      Code:
      try {
      	plLabelContainer.hide();
      } catch (err) {
      	isc.VLayout.create({
      	    members:[
      	        plAddToPortfolioLabel,
      	        plSrAddPortfolioLabel
      	    ],
      	    left:30,
      	    top:10,
      	    height:50,
      	    width:140,
      	    border:"1px solid green",
      	    ID:"plLabelContainer",
      	    autoDraw:false,
      	    overflow:"hidden"
      	})
      }
      
      try {
      	plPortSLContainer.hide();
      } catch (err) {
      	isc.HLayout.create({
      	    members:[
      	    	//plLabelContainer,
      	    	plAddToPortfolioLabel,
      	        plPortfolioSelectList
      	    ],
      	    width:450,
      	    height:200,
      	    ID:"plPortSLContainer",
      	    border:"1px solid orange",
      	    autoDraw:false,
      	    overflow:"hidden"
      	})
      }
      Last edited by svonmiller; 8 Nov 2010, 13:28.

      Comment


        #4
        addChild(xxxxx) with positions , remeber try overflow,relative,and more....

        Comment

        Working...
        X