PDA

View Full Version : [CLOSED] Problem with collapsible panel.



feanor91
Jun 12, 2012, 6:02 PM
Hello

I have some charts I display on screen (you rember, the 11 ones...)

I want to print the charts with a colapible panel attache to them.

See before print what I have on screen :

4358

When I click on print button, I expand all my panel collapsed, resize chart, do some stuff and print. All works well.

After that, I undo all I have done to prepare printing and so, I collapsed my panel again but here what I get:

4357

Question : how I rid off this header that appears and I didn't want?

Daniil
Jun 12, 2012, 7:24 PM
Hi,

Are you able to reproduce it with a simple example?

For now, I have no idea how to reproduce the second screenshot and what exactly can cause such behavior. So, I can't suggest anything.

feanor91
Jun 12, 2012, 8:39 PM
Yes, I think I can, I will do that tommorow.

It's rather simple : a panel with layout Border, a west reigon wihth Header=false collapsed, a buton click on it expand region, a second button click on it collapse the region, if all works fine, when collapsed, the header must be here. I will post example as soon as I have one

Edit:

Example :



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

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

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
// Build Panel for West Region
Ext.Net.Panel pnl = new Ext.Net.Panel();
pnl.ID = "Panel1";
pnl.Header = false;
pnl.Collapsible = false;
pnl.Split = false;
pnl.Collapsed=false;
pnl.Width = Unit.Pixel(175);
pnl.Region = Region.West;

// Build TabPanel for Center Region
Ext.Net.Panel tab1 = new Ext.Net.Panel();
tab1.Title = "First Tab";
tab1.BodyStyle = "padding: 6px;";
tab1.Html = "First Tab";


Ext.Net.Panel tab2 = new Ext.Net.Panel();
tab2.Title = "Another Tab";
tab2.BodyStyle = "padding: 6px;";
tab2.Html = "Another Tab";

Ext.Net.Panel tab3 = new Ext.Net.Panel();
tab3.Title = "Closeable Tab";
tab3.Closable = true;
tab3.BodyStyle = "padding: 6px;";
tab3.Html = "Closeable Tab";

TabPanel tp = new TabPanel();
tp.ID = "TabPanel1";
tp.Region = Region.Center;

// Set first Tab to be the .ActiveTabIndex
tp.ActiveTabIndex = 0;

// Add Tabs to TabPanel
tp.Items.Add(tab1);
tp.Items.Add(tab2);
tp.Items.Add(tab3);

// Build Window to hold everything
Window win = new Window();
win.ID = "Window1";
win.Layout = LayoutType.Border.ToString();
win.Title = "Simple Layout";
win.Icon = Icon.Application;
win.Width = Unit.Pixel(600);
win.Height = Unit.Pixel(350);
win.Border = false;
win.Collapsible = true;
win.Plain = true;

win.Items.Add(pnl);
win.Items.Add(tp);

// Add Window to Form
this.PlaceHolder1.Controls.Add(win);
}
</script>

<!DOCTYPE html>

<html>
<head id="Head1" runat="server">
<title>Simple BorderLayout - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" type="text/css" />
</head>
<body>
<ext:ResourceManager ID="ResourceManager1" runat="server" />

<h1>Simple BorderLayout in CodeBehind</h1>

<ext:Button
ID="Button1"
runat="server"
Text="Collapse west"
Icon="Application">
<Listeners>
<Click Handler="#{Panel1}.collapse();" />
</Listeners>
</ext:Button>

<asp:PlaceHolder ID="PlaceHolder1" runat="server" />
</body>
</html>

Click on the button. I doesnt want ro see the header when panel is collapsed. The expand and collapse functionality are managed by button depending of user choice, and if panels are collapsed I need to have all the surface of the parent pannel occupied by the chart.

feanor91
Jun 13, 2012, 8:58 AM
I found a turn over by using hide.show method instead of expand and collapse, but I think it will be a good idea to see it there is a way to achive that with collpase/expand.

Daniil
Jun 13, 2012, 1:26 PM
Thanks for the example.

Please set up

pnl.CollapseMode = CollapseMode.Mini;
for the west region Panel.

feanor91
Jun 13, 2012, 2:33 PM
Thanks for the example.

Please set up

pnl.CollapseMode = CollapseMode.Mini;
for the west region Panel.

It works...Strange, I already tried it under VB and it did not the trick....Well, I will investigate. Thanks, you can close the thread.