Mar 31, 2011, 9:01 PM
[CLOSED] TabPanel tabs are not hiding
Hi,
In a page I am using one TabPanel which contain around 3 tabs. At the time of loading the page only first tab needs to show in the table panel and rest of all needs to hide. Then based on button event the respective tabs need to show up. Please check the following code. The tabs are not hiding initially. Instead of .hide() if I use .visible=false; initially it is hiding, but not showing in button events.
In a page I am using one TabPanel which contain around 3 tabs. At the time of loading the page only first tab needs to show in the table panel and rest of all needs to hide. Then based on button event the respective tabs need to show up. Please check the following code. The tabs are not hiding initially. Instead of .hide() if I use .visible=false; initially it is hiding, but not showing in button events.
<%@ 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">
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
pnlSection2.Hide();
pnlSection3.Hide();
}
}
public void ShowSectionSelected(Object sender, DirectEventArgs e)
{
Ext.Net.Button btn;
btn = (Ext.Net.Button)sender;
if (btn.ID == "btn2")
pnlSection2.Show();
else
pnlSection3.Show();
}
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<ext:ResourceManager ID="ResourceManager" runat="server" />
<ext:Viewport ID="vpReqFields" runat="server" Layout="border">
<Items>
<ext:TabPanel ID="tabSections" runat="server" ActiveTabIndex="0" Title="TabPanel"
Region="Center">
<Items>
<ext:Panel ID="pnlSection1" runat="server" Title="Section 1" Layout="Fit" BodyStyle="background-color:#d9d9d9">
</ext:Panel>
<ext:Panel ID="pnlSection2" runat="server" Title="Section 2" Layout="Fit" BodyStyle="background-color:#d9d9d9">
</ext:Panel>
<ext:Panel ID="pnlSection3" runat="server" Title="Section 3" Layout="Fit" BodyStyle="background-color:#d9d9d9">
</ext:Panel>
</Items>
</ext:TabPanel>
<ext:Panel ID="pnlButtons" runat="server" Region="South" Height="40" ButtonAlign="Center">
<Items>
</Items>
<Buttons>
<ext:Button ID="btn2" runat="server" Text="Show Section 2">
<DirectEvents>
<Click OnEvent="ShowSectionSelected">
<EventMask ShowMask="true" Msg="Loading..." />
</Click>
</DirectEvents>
</ext:Button>
<ext:Button ID="btn3" runat="server" Text="Show Section 3">
<DirectEvents>
<Click OnEvent="ShowSectionSelected">
<EventMask ShowMask="true" Msg="Loading..." />
</Click>
</DirectEvents>
</ext:Button>
</Buttons>
</ext:Panel>
</Items>
</ext:Viewport>
</form>
</body>
</html>
Last edited by Daniil; Apr 09, 2011 at 12:46 PM.
Reason: [CLOSED]