PDA

View Full Version : Suppress expand of region



Notre
14 Nov 2013, 2:38 PM
Hi,

I've got a viewport setup such that one of the items is a collapsible panel. When the user clicks on the chevron button on the title bar, if the panel is expanded it collapses. This is desired. When the user clicks on the chevron button of the collapsed panel, the panel is expanded. This is also good.

When the user clicks on an area of the collapsed panel, other than the chevron button, then the panel temporarily expands until the user moves focus away from the collapsible panel. At this point, the panel collapses. I have the requirement that when the user clicks on anything except the chevron button of the collapsed panel, nothing should happen.

I set up a handler on the panel header's click event, and my breakpoint is hit. Inside my handler, I called stopEvent() on the provided event object. I also tried returning false in my handler. While my handler is called, the default Sencha behaviour still occurs when the user clicks the collapsed panel; the panel slides out.

How would I prevent the default behaviour that occurs when clicking on the collapsed panel (other than the expand/collapse chevron button)?

Thanks!
Notre

Piruthu
15 Nov 2013, 1:10 AM
Set 'floatable (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.panel.Panel-cfg-floatable)' to false, this will force the user to fully expand a collapsed region by clicking the expand button alone.

Notre
15 Nov 2013, 2:47 PM
I'm still not clear on why I can't suppress the click, but setting the floatable configuration to false does work!