PDA

View Full Version : Expand collapsed panel upon clicking the collapsed bar ..



Tatonka
29 Oct 2012, 4:41 AM
Hi,

there is probably a dead simple solution to this, but I just can't seem to find it.

I have a panel, which is collapsible. Now I want to allow the user to click anywhere on the title bar to collapse and expand the panel, instead of just the little button.
I managed to add a click listener to the header easy enough to collapse the panel. But I can't find anything for the collapsed state. Apparently the title bar displayed there is not the same as for the expanded panel.

Don't know if that is important, but the panel has a regular title bar but collapses to the left hand side .. so has a vertical bar in the collapsed state.

Sorry for the confusing description. Any hint or help is greatly appreciated.

Thanks
T.

Tatonka
31 Oct 2012, 1:20 AM
Nobody an idea where to look for the collapsed bar thing?

T.

evant
31 Oct 2012, 1:31 AM
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-cfg-titleCollapse



Ext.onReady(function(){

Ext.create('Ext.container.Viewport', {
layout: 'border',
items: [{
region: 'west',
title: 'Foo',
collapsible: true,
titleCollapse: true,
floatable: false,
width: 200
}, {
region: 'center'
}]
});

});

Tatonka
31 Oct 2012, 1:44 AM
Hi evant,

thanks for the hint .. that was really simple. A bit embarrassed not having found it myself actually :-)

The additional floatable: false was what really did the trick for me, because my panel, did render properly in float mode.

Thanks again for the help.

T.