Jun 18, 2013, 11:36 AM
[CLOSED] Unnecessary scroll bars
Hello,
I am getting unnecessary scroll bars probably because of layout misconfiguration. Below is a simplified code.
main.aspx
1) Unnecessary vertical scroll bar in Home tab panel
2) Unnecessary horizontal scroll bar in Second tab.
Known:
1) If I set "Height" for Panel1 in Child.aspx, horizontal scroll bar disappears as I wanted. I can not set height for Panel1 becuse in the real scenario, its content's height is unknown (Panel6 height=200 is only for sample issues), normally an image is loaded there with a variable height.
Desired behavior for both pages:
1) Initially no vertical or horizontal scroll bars should appear and the pages should fit browser (assuming it is maximized).
2) If browser window is resized I don't want the tabs get smaller than 800x600px and vertical/horizontal scroll bars should appear.
Can you help on the issue?
Thanks.
I am getting unnecessary scroll bars probably because of layout misconfiguration. Below is a simplified code.
main.aspx
<%@ Page Language="C#" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
TabPanel ParentTab = new TabPanel();
ParentTab.Icon = Icon.Cog;
ParentTab.ID = "SeconndTabRoot";
ParentTab.Title = "Second";
ParentTab.Layout = "FitLayout";
ParentTab.Closable = true;
MainTabPanel.Items.Add(ParentTab);
ParentTab.Render();
Ext.Net.Panel NewPanel = new Ext.Net.Panel();
NewPanel.ID = "ChildTab";
NewPanel.Loader = new ComponentLoader
{
Url = "/Child.aspx",
Mode = LoadMode.Frame
};
NewPanel.Title = "Child";
NewPanel.Layout = "FitLayout";
NewPanel.Border = false;
NewPanel.Closable = true;
NewPanel.Listeners.Close.Handler = "if(item.ownerCt){if(item.ownerCt.items){if(item.ownerCt.items.length){if(item.ownerCt.items.length == 1){item.ownerCt.close();}}}}";
NewPanel.AddTo(ParentTab);
ParentTab.SetActiveTab(NewPanel);
}
</script>
<!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 id="Head1" runat="server">
<title>Ext.Net Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport ID="Viewport1" runat="server" Layout="BorderLayout">
<Items>
<ext:Panel runat="server" ID="MainMenuPanel" Region="West" Layout="AccordionLayout" Collapsible="true" Split="true" Title="Menu" Width="200" MinWidth="200" MaxWidth="400" >
</ext:Panel>
<ext:TabPanel runat="server" ID="MainTabPanel" Region="Center" Layout="FitLayout" >
<Items>
<ext:Panel runat="server" ID="HomePanel" Closable="false" Title="Home" Icon="House" Layout="AnchorLayout" BodyPadding="5" AutoScroll="true" Border="false">
<Items>
<ext:Panel runat="server" ID="WelcomeMessageLabel" Border="false" MarginSpec="0 0 5 0">
</ext:Panel>
<ext:Panel ID="HomeContentPanel" runat="server" Layout="AnchorLayout" Flex="1" MinWidth="800" MinHeight="550" AnchorHorizontal="100%" AnchorVertical="100%" Border="false">
<Items>
<ext:Panel runat="server" ID="MyCharts" Layout="HBoxLayout" AnchorHorizontal="100%" AnchorVertical="40%" BodyPadding="5" Border="false">
</ext:Panel>
<ext:TabPanel runat="server" ID="MyNotifications" AnchorHorizontal="100%" AnchorVertical="60%" Border="true" MarginSpec="0 0 20 0" MaxTabWidth="230">
</ext:TabPanel>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
Child.aspx:<%@ 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 id="Head1" runat="server">
<title>Ext.Net Example</title>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<ext:Viewport ID="MyViewport" runat="server" Layout="FitLayout">
<Items>
<ext:TabPanel runat="server" ID="MyTabPanel" Layout="FitLayout">
<Items>
<ext:Panel runat="server" ID="MyPanel" BodyPadding="10" Title="Enterprise Summary" AutoScroll="true">
<Items>
<ext:Panel runat="server" ID="ContentPanel1" Layout="FitLayout" Title="Content 01" Height="100">
</ext:Panel>
<ext:Panel runat="server" ID="ContentPanel2" Layout="VBoxLayout" Title="Content 02" MarginSpec="0 0 10 0" BodyPadding="15">
<LayoutConfig>
<ext:VBoxLayoutConfig Align="Stretch"></ext:VBoxLayoutConfig>
</LayoutConfig>
<Items>
<ext:Panel runat="server" ID="Panel1" Layout="HBoxLayout">
<LayoutConfig>
<ext:HBoxLayoutConfig Align="Stretch" Pack="Center"></ext:HBoxLayoutConfig>
</LayoutConfig>
<Items>
<ext:Panel ID="Panel6" runat="server" Layout="FitLayout" Border="false" Height="200">
</ext:Panel>
</Items>
</ext:Panel>
<ext:Panel runat="server" ID="Panel2" Layout="HBoxLayout" Height="450">
</ext:Panel>
<ext:Panel runat="server" ID="Panel3" Layout="HBoxLayout" Height="450">
</ext:Panel>
<ext:Panel runat="server" ID="Panel4" Layout="HBoxLayout" Height="450">
</ext:Panel>
<ext:Panel runat="server" ID="Panel5" Layout="HBoxLayout" Height="450">
</ext:Panel>
</Items>
</ext:Panel>
</Items>
</ext:Panel>
</Items>
</ext:TabPanel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
Problems:1) Unnecessary vertical scroll bar in Home tab panel
2) Unnecessary horizontal scroll bar in Second tab.
Known:
1) If I set "Height" for Panel1 in Child.aspx, horizontal scroll bar disappears as I wanted. I can not set height for Panel1 becuse in the real scenario, its content's height is unknown (Panel6 height=200 is only for sample issues), normally an image is loaded there with a variable height.
Desired behavior for both pages:
1) Initially no vertical or horizontal scroll bars should appear and the pages should fit browser (assuming it is maximized).
2) If browser window is resized I don't want the tabs get smaller than 800x600px and vertical/horizontal scroll bars should appear.
Can you help on the issue?
Thanks.
Last edited by Daniil; Jun 19, 2013 at 1:10 PM.
Reason: [CLOSED]