PDA

View Full Version : Fire event when region is open



Stephan123
24 Aug 2009, 3:54 AM
Hello !

I have test an closable region.
When i open a closable region i need an reaction.
I have test with several variants.
But i becam no reaction.
For example:



new Ext.Viewport({
layout: 'border',
items: [{
xtype: 'panel',
title: 'Center',
region: 'center'
},{
xtype: 'form',
region: 'east',
id: 'east',
width: 300,
title: 'form',
collapsible: true,
collapsed: true,
listeners:{
show: function() {
alert('show');
}
},
items: [{
fieldLabel: 'Feld 1',
xtype: 'textfield'
},{
fieldLabel: 'Feld 2',
xtype: 'textfield'
}]
}]
});
Your sincerly

Stephan

steffenk
24 Aug 2009, 4:05 AM
use afterlayout event from viewport

Animal
24 Aug 2009, 4:07 AM
Its the expand event on that region that you must listen for.

To be notified when it expands(!)

Could you not look at the docs and figure this out?

steffenk
24 Aug 2009, 4:17 AM
Hi Animal,

i also consulted the docs, and Region says:
Public Events
This class has no public events.

but in source i see

p.on({
beforecollapse: this.beforeCollapse,
collapse: this.onCollapse,
beforeexpand: this.beforeExpand,
expand: this.onExpand,
hide: this.onHide,
show: this.onShow,
scope: this
});

Animal
24 Aug 2009, 4:22 AM
Ah well, the docs are not perfect yet. They are constantly evolving...

Animal
24 Aug 2009, 4:37 AM
In fact the config and events are on Panel The region must be a Panel to be collapsible.

This is not really good. The BorderLayout classes need a complete rewrite.

steffenk
24 Aug 2009, 4:39 AM
that's what i saw too. Yes, that's totally confusing ...