PDA

View Full Version : [CLOSED] Expand panel when click on the title



RCN
Jun 05, 2012, 5:45 PM
Hi folks, i have a panel with TitleCollapse property set to true but when i click the title it expands the panel "partially". I would like to know whether itīs possible to make clicking on the title act like clicking the Collapse Tool.

Daniil
Jun 05, 2012, 6:56 PM
Hi,

It appears clicking on title and collapse tool causes the same effect in the following example.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<ext:ResourceManager runat="server" />

<ext:Panel
runat="server"
Width="200"
Height="200"
Collapsible="true"
TitleCollapse="true"
BodyStyle="background-color: green;" />
</body>
</html>

RCN
Jun 05, 2012, 7:17 PM
if you click outside the panel it will collapse.

Daniil
Jun 05, 2012, 9:31 PM
Seems nothing happens when I click outside the Panel in my example.

Did I miss or misunderstand something?

RCN
Jun 06, 2012, 3:43 AM
i am gonna prepare a running example for explain better.

RCN
Jun 06, 2012, 12:44 PM
Hi Daniil, i would like that the South region of my example acts like your example. When the title is clicked, it just expand "partially" and the BeforeExpand event is not raised and if i click outside the south region, it will collapse.



<ext:Window ID="Window2" runat="server" Title="Region" Icon="Application"
Width="600" Height="350" X="100" Y="100"
Layout="BorderLayout">
<Items>
<ext:Panel ID="Panel1" runat="server" Region="Center" Title="Center region" />
<ext:Panel ID="SouthPanel" runat="server" Title="South" Region="South" Collapsible="true"
MinHeight="100" Split="true" Height="100" TitleCollapse="false" Collapsed="true">
<Listeners>
<BeforeExpand Handler="alert('before expand');" />
</Listeners>
</ext:Panel>
</Items>
</ext:Window>


In your example when i click the title it will be fully expand and will raise the BeforeExpand event


<ext:Panel ID="Panel2" runat="server" Width="200" Height="200" Collapsible="true"
TitleCollapse="true" BodyStyle="background-color: green;">
<Listeners>
<BeforeExpand Handler="alert('before expand');" />
</Listeners>
</ext:Panel>



Maybe itīs not possible to have this behaviour when using BorderLayout but i think that at least the BeforeExpand event should be raised.

Thanks in advance

Daniil
Jun 06, 2012, 1:06 PM
Well, you should set up

Floatable="false"
for the south Panel.
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-cfg-floatable

And

TitleCollapse="true"
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.panel.Panel-cfg-titleCollapse

RCN
Jun 06, 2012, 1:11 PM
Thank you Daniil, please mark it as resolved