View Full Version : LayoutRegion.removeAllPanels request
tryanDLS
11-02-2006, 11:50 AM
Jack,
What do think about adding a way to remove all panels from a region without having to loop thru and get ids and repeatedly call remove(), or worse doing region.panels = [].
Also, maybe add a flag indicating whether deactivate should be fired or not.
jack.slocum
11-02-2006, 04:47 PM
deactivate is always going to fire, that is a contract with listeners. You can beginUpdate/endUpdate the layout to avoid relayouts while removing.
I added "clearPanels()" for you. It was so simple with the new MixedCollection object in the region code. With MixedCollection you can now access panels by id or index and it greatly reduces the repetitive array handling code.
When I get the time, I am going to use the full power of MixedCollection and use it's modification events so you can add panels directly to it and have them reflected in the region. For example:
var north = layout.getRegion('north');
north.panels.add(...);
north.panels.insert(0, ...);
north.panels.replace('center1', ...);
etc.
tryanDLS
11-02-2006, 04:52 PM
Cool, when will you be releasing a new version of the beta code? It looks like you're starting to implement it - I see ...beta2.js in some of your code :)
jack.slocum
11-02-2006, 05:11 PM
Part of the testing process is putting it on my blog and seeing what it breaks... That beta2 is about 4 days behind, which is like 4 months in yui-ext time. :lol:
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.