PDA

View Full Version : Accordion Panels don't expand



haj
8 Mar 2011, 1:47 AM
I have a little trouble with getting accordion to work properly.

With the following code, the panels don't expand when I click on them:



var fieldset1 = new Ext.Panel({
xtype:'fieldset',
title: 'Product information',
items: [{
xtype: "label", html: "<br>"
},{
xtype: 'compositefield',
hideLabel: true,
defaults: {flex: 1},
items: [{
xtype: "label", text: "Number:"
},{
xtype: 'textfield',
name: 'ProductNumber',
width: 700
}]
},{
xtype: "label", html: "<br><br>"
},{
xtype: 'compositefield',
hideLabel: true,
defaults: {flex: 1},
items: [{
xtype: "label", text: "Name:"
},{
xtype: 'textfield',
name: 'ProductName',
width: 700
}]
},{
xtype: "label", html: "<br><br>"
}]
});


When I add a listener on expand, without any content, it opens, but firebug complains about an error:



var fieldset1 = new Ext.Panel({
listeners: {
expand: {}
},
etc...


the error is

m.fireFn.apply is not a function

in line 7 in ext-all.js (column 22460).

Now, the natural thing would be to add some function - but whatever I put in just leads me back to the first problem...

Cloetn
8 Mar 2011, 2:22 AM
I suppose your fieldSet 1 is your main panel and the compositefields are panels aswell?

If so , you should the layout of your main panel to 'accordion

fieldSet 1:


layout:'accordion'

haj
8 Mar 2011, 2:41 AM
No, there are fieldset2 - 4 as well. They are all inside this panel:



var accordion = new Ext.Panel({
region:'east',
margins:'5 0 5 5',
split:true,
width: 800,
labelWidth: 125,
layout:'accordion',
items: [fieldset1, fieldset2, fieldset4, fieldset3]
});


which itself is inside a FormPanel.

mitchellsimoens
8 Mar 2011, 4:28 AM
Just a side note, you can yourself delete the two other posts you made. There is an edit button at the bottom right of all your posts. Click on that then you can go through and delete them.

haj
9 Mar 2011, 12:21 AM
I figured I could, but must have overlooked that button.

Will do so in the future :)