PDA

View Full Version : Calling collapsed() on an Ext.panel.Panel no longer fires beforeexpand and expand



theCowboy
24 Jun 2013, 9:14 AM
Using 4.2.1, calling myPanel.collapsed() on an Ext.panel.Panel (within a controller) no longer fires beforeexpand and expand events, but using myPanel.collapsed = true still fires the beforeexpand and expand events.

slemmon
26 Jun 2013, 2:03 PM
It seems to work ok for me (see example below):



Ext.define('Test.controller.Main', {
extend: 'Ext.app.Controller',


init: function () {
this.control({
panel: {
beforeexpand: function () { console.log('beforeexpand event fired'); },
expand: function () { console.log('expand event fired'); }
}
});
}
});


Ext.application({
name: 'Test',


controllers: ['Test.controller.Main'],

launch: function () {
Ext.widget('panel', {
renderTo: Ext.getBody(),
title: 'Collapse / Expand',
height: 200,
width: 200,
collapsible: true
});
}
});