PDA

View Full Version : Accordion Layout - Add a Button or a formpanel that looks like a button.



muncher
10 Aug 2010, 9:53 AM
I have setup a panel with accordion layout. It works fine. But now I want to add another tab, that behaves like a button.


Basically, I was able to get upto this point -


....
....
layout : {
type : 'accordion',
animate : true,
fill:false
},
items : [new Ext.myLib.Form1(),
new Ext.FormPanel( {
labelWidth : 75, // label settings here cascade unless overridden
url : '',
frame : true,
title : 'Title2',
bodyStyle : 'padding:5px 5px 0',
width : 350}),
//This formpanel
new Ext.FormPanel({})]
............
............
............


I want the third formpanel to behave more like a button. That is when I click on it, I can catch that event and carry on forward with that. Also, taking off the + sign on that form would be nicer.

10 Aug 2010, 9:59 AM
Accordion can only have children that are panels or any subclass thereof.

muncher
10 Aug 2010, 10:13 AM
Ok. But then I can create an empty panel instead but how do I get the click on the formpanel ? Is there no event generated for formpanel ?

Animal
10 Aug 2010, 10:16 AM
A click on the Panel's body element?

Add a listener to the Panel's body element.

When it has a body element.