Help Please - How to get Containers(Dynamically added)

58 vaatamist
Liigu esimese lugemata sõnumi juurde

thane...@gmail.com

lugemata,
23. aug 2012, 18:01:4423.08.12
kuni wir...@googlegroups.com
Hi 

Can some one please point me to a right direction to get the Container which are added to the layer.

If i add a new Layer i am able to get them.
 l = new Y.Layer({
       render: Y.one('#layer')
 });
var containerList = l._items;
containerList .each( function ( item ) {
//do some other thing
});

but using this type my not able to figure it out how to get the container items from the example code provided in download
YUI_config.groups.wireit.base = '../src/';
YUI({combine: false, filter: 'raw'}).use('bezier-wire', 'container','image-container',function(Y) {

  window.Y = Y;

  var layerEl = Y.one('#layer');
  
  
  var mygraphic = new Y.Graphic({render: "#layer"});

 new Y.Container({
    children: [
      { align: {points:["tl", "tl"]} },
      { align: {points:["tl", "bc"]} }
    ],
    
    render: layerEl,
    xy: [200,100],
    width: 200,
    height: 100,
    headerContent: 'headerContent',
    bodyContent: 'bodyContent',
    footerContent: 'footerContent'
  });
  
  new Y.Container({
    children: [
      {
        align: {points:["tl", "tl"]},
dir: [-1,-1]
      }
    ],
    render: layerEl,
    xy: [350,200],
    headerContent: 'sample container',
    bodyContent: 'bodyContent'
  });
  
  new Y.Container({
    children: Y.ContainerBase.EIGHT_POINTS,
    render: layerEl,
    width: 200,
    height: 100,
    xy: [500,200],
    headerContent: '9 terminals',
    bodyContent: 'bodyContent',
    footerContent: 'footerContent'
  });
  
  new Y.ImageContainer({
    children: Y.ContainerBase.EIGHT_POINTS,
    render: layerEl,
    xy: [700,30],
  });

THanks

Thanesh

thane...@gmail.com

lugemata,
23. aug 2012, 18:05:1523.08.12
kuni wir...@googlegroups.com,thane...@gmail.com
I am adding the container to the layer by using

layer.add()

Thanks

THanesh

Eric Abouaf

lugemata,
29. aug 2012, 06:59:0429.08.12
kuni wir...@googlegroups.com
Hi,

Yes, the Layer is a WidgetParent. ( and the associated childs are Containers).

So using layer.add() is the right way to add a container...

Doc coming soon...

Cheers,

--
You received this message because you are subscribed to the Google Groups "WireIt" group.
To view this discussion on the web visit https://groups.google.com/d/msg/wireit/-/aBDQo8JFAtwJ.

To post to this group, send email to wir...@googlegroups.com.
To unsubscribe from this group, send email to wireit+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/wireit?hl=en.



--
Eric Abouaf
eric....@gmail.com
Tél: 06 29 86 37 89
Vasta kõigile
Vasta autorile
Saada edasi
0 uut sõnumit