Adding/removing children to a layout?

177 views
Skip to first unread message

Ed

unread,
Sep 13, 2012, 6:37:21 PM9/13/12
to jla...@googlegroups.com
I'd like to dynamically add/remove children to a grid layout, is there an example of how to do this? I'm calling my top-level layout() after changing the DOM but nothing seems to be happening (I see the new child element but it isn't laid out correctly, i.e. it appears at offset 0,0).

Bram Stein

unread,
Sep 14, 2012, 4:18:44 AM9/14/12
to jla...@googlegroups.com
You mentioned you called the top-level `layout()`. Did you also call the lower level `layout()` methods? jLayout does not do this automatically as it leaves up to the user to implement a component hierarchy (if you need it.)

Ed

unread,
Sep 17, 2012, 2:10:39 PM9/17/12
to jla...@googlegroups.com
I'm calling at the sub-layouts' layout() methods when I create the hierarchy, and it seems to be working correctly.

I looked through the code a bit and I suspect the layout's item[] array is immutable once the layout is created, correct?
It would be nice to have an addItem() and removeItem() method so layouts could be used with dynamic content. For
now I can work around things by toggling the visibility of the select widgets.

  - Ed
Reply all
Reply to author
Forward
0 new messages