Reputation: 20313
We are using fieldset in our application using extjs3.Now we are moving forward to extjs4.So beforeexpand and beforecollapse are not working in extjs4.Is there any chance to use these or else any replacement to these events.Please help me.I am searching a lot for these.
Upvotes: 2
Views: 3931
Reputation: 22386
Yes, there are no such events but it's easy to create them by yourself. Here's my fieldset which extends original one and has requested events:
Ext.define('MY.fieldset', {
extend: 'Ext.form.FieldSet',
alias: 'widget.myfieldset',
initComponent: function() {
this.addEvents('beforeexpand', 'beforecollapse');
this.callParent([arguments]);
},
setExpanded: function(expanded){
var bContinue;
if (expanded)
bContinue = this.fireEvent('beforeexpand', this);
else
bContinue = this.fireEvent('beforecollapse', this);
if (bContinue !== false)
this.callParent([expanded]);
}
});
And here is working example.
Upvotes: 7