-
21 Jul 2010 5:42 PM #1
Making an accordion element refresh its layout when expanded
Making an accordion element refresh its layout when expanded
Does anyone know how to call doLayout() on an item when it is expanded? I have an application where there's an accordion element containing several formpanels. These formpanels have composite fields that don't render on the non-expanded formpanels, but I can make them render by using the form's doLayout() function. I have tried adding this property to the form using the onExpand property:
But this causes my form not to work and throws JS error messages. Does anyone know how I can cause the doLayout() function to fire whenever a given form in the accordion is expanded? Thanks for any help.Code:Ext.form.CalcFormPanel = Ext.extend(Ext.form.FormPanel, { labelWidth: 75, bodyStyle:'padding:5px 5px 0', border:false, onExpand: function() { this.doLayout(); }, width: 280, defaults: {width: 80}, forceLayout: true, defaultType: 'textfield' });
-
24 Jul 2010 4:03 PM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
You can't add arbitrary members to a class and expect the class to call it.
Code:Ext.form.CalcFormPanel = Ext.extend(Ext.form.FormPanel, { labelWidth: 75, bodyStyle:'padding:5px 5px 0', border:false, initComponent: function() { Ext.form.CalcFormPanel.superclass.initComponent.call(this); this.on('expand', this.doLayout, this); }, width: 280, defaults: {width: 80}, forceLayout: true, defaultType: 'textfield' });
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
Similar Threads
-
[RESOLVED] No expanded item accordion layout
By senacle in forum Ext 3.x: Help & DiscussionReplies: 3Last Post: 2 May 2010, 11:52 PM -
[RESOLVED] No expanded items in accordion layout
By senacle in forum Ext 3.x: Help & DiscussionReplies: 4Last Post: 25 Mar 2010, 12:35 AM -
Way to keep at least one panel in an accordion layout always expanded?
By Gjslick in forum Ext 2.x: Help & DiscussionReplies: 16Last Post: 8 Mar 2010, 2:51 PM -
Ext2.0 accordion load content on accordion expanded
By ectalk in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 3 Oct 2007, 8:10 PM -
[Ext 2.0] - Making a div accordion
By undefined in forum Ext 1.x: Help & DiscussionReplies: 2Last Post: 30 Aug 2007, 7:58 AM


Reply With Quote