PDA

View Full Version : how to trigger a close function of contentpanel



hsy541
9 Aug 2007, 12:49 AM
If i want to trigger a close function of Ext.ContentPanel in the center of the BorderLayout
What can i do?

evant
9 Aug 2007, 1:01 AM
layout.getRegion('center').remove(something);


http://extjs.com/deploy/ext/docs/output/Ext.LayoutRegion.html#remove

hsy541
9 Aug 2007, 1:08 AM
Sorry I made a mistake what i mean is that if i want to do something when i close a ContentPanel what should i do?

Skeleton
9 Aug 2007, 1:30 AM
Here is a code snippet from one of our project which listens for content panel removals on center region:


layout = new Ext.BorderLayout(document.body, {
...
...
});

centerRegion = layout.getRegion('center');

centerRegion.on('panelremoved', function(region, panel) {

// Here, you can use the incoming region and panel objects accordingly

}, this);

hsy541
9 Aug 2007, 6:02 AM
Thanks I think I should learn how to read the API doc.