load the tabpanel to dynamic title, But the title not show?
Code:
this.Details.Header = true;
this.Details.SetTitle(group.G_CName);
string url = "Render.aspx?GroupID=" + groupID.ToString();
LoadConfig load_config = new LoadConfig(url, LoadMode.IFrame, false);
Details.LoadContent(load_config);
</PRE>
Code:
<Center>
<ext:TabPanel ID="Details" runat="server" EnableTabScroll="true">
</ext:TabPanel>
</Center>
</PRE>
RE: load the tabpanel to dynamic title, But the title not show?
Hi,
TabPanel has no header therefore you can't use Title. Also TabPanel should display tabs therefore it doesn't make sense use AutoLoad for TabPanel. Use Panel
RE: load the tabpanel to dynamic title, But the title not show?
<DIV align=left>This function show the title. why?
Code:
var loadPage = function(tabPanel, node) {
//addTab(tabPanel, node.id, node.text, node.attributes.href);
var tab = tabPanel.getItem(node.id);
if (!tab) {
tab = tabPanel.add({
id: node.id,
title: node.text,
closable: true,
autoLoad: {
showMask: true,
url: node.attributes.href,
mode: 'iframe',
maskMsg: 'Loading ' + node.attributes.href + '...'
},
listeners: {
update: {
fn: function(tab, cfg) {
cfg.iframe.setHeight(cfg.iframe.getSize().height - 20);
},
scope: this,
single: true
}
}
});
}
tabPanel.setActiveTab(tab);
}
</PRE>
RE: load the tabpanel to dynamic title, But the title not show?
Hi,
This function adds new tab and activate it. How this function related with code from first post?
I am not sure what you try accomplish and what problems do you have. May be you can provide more details?
RE: load the tabpanel to dynamic title, But the title not show?
The layout was the pages templete. I need load the default page.
the following was the pages code:
Code:
<%@ Page Language="C#" MasterPageFile="~/Manager/MasterPage/PageTemplate.Master" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="FrameWork.web.Manager.Module.Information.Label.List" %></PRE><%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<asp:Content ID="Content1" ContentPlaceHolderID="PageBody" runat="server">
<script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>Manager/inc/FineMessBox/js/common.js"></script></PRE> <script type="text/javascript" src="<%=Page.ResolveUrl("~/") %>Manager/inc/FineMessBox/js/subModal.js"></script>
<script type="text/javascript">
var loadPage = function(tabPanel, node) {
//addTab(tabPanel, node.id, node.text, node.attributes.href);
var tab = tabPanel.getItem(node.id);
if (!tab) {
tab = tabPanel.add({
id: node.id,
title: node.text,
closable: true,
autoLoad: {
showMask: true,
url: node.attributes.href,
mode: 'iframe',
maskMsg: 'Loading ' + node.attributes.href + '...'
},
listeners: {
update: {
fn: function(tab, cfg) {
cfg.iframe.setHeight(cfg.iframe.getSize().height - 20);
},
scope: this,
single: true
}
}
});
}
tabPanel.setActiveTab(tab);
}
function addTab(tabPanel, id, title, url)
{
alert("id=" + id + ";title=" + title + ";url" + url);
var tab = tabPanel.getItem(id);
if (!tab)
{
tab = new Ext.Panel({
id: id,
title: 'loading....',
defaultTitle: title,
closable: true,
autoLoad: {
showMask: true,
url: url,
mode: 'iframe',
maskMsg: 'loading....',
scripts: true
}
});
var updatePanel = function(tab, resObj)
{
for (var i = 0; i < window.self.frames.length; i++)
{
if (window.self.frames[i].name == tab.iframe.dom.id)
{
tab.autoLoad.url = window.self.frames[i].location;
var newTitle = title;
if (newTitle)
{
tab.setTitle(newTitle);
}
else
{
tab.setTitle( tab.defaultTitle || 'loaded' );
}
}
}
}
tab.on('update', updatePanel);
tab = tabPanel.add(tab);
}
tabPanel.setActiveTab(tab);
}
</script>
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<ext:ViewPort ID="ViewPort1" runat="server">
<Body>
<ext:BorderLayout ID="BorderLayout1" runat="server">
<North>
<ext:Panel ID="Panel1" runat="server" Title="??????:????" Icon="Briefcase">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server" >
<Items>
<ext:ToolbarButton ID="Button1" runat="server" Text="????" Icon="Pencil" StandOut="true">
<AjaxEvents>
<Click OnEvent="Edit">
<EventMask ShowMask="true" Msg="??loading??,??? ..."/>
</Click>
</AjaxEvents>
<ToolTips>
<ext:ToolTip ID="ToolTip1" runat="server" Html="??????" />
</ToolTips>
</ext:ToolbarButton>
<ext:ToolbarButton ID="ToolbarButton3" runat="server" Icon="Delete" StandOut="true" Text="??">
<AjaxEvents>
<Click OnEvent="Delete">
<EventMask ShowMask="true" Msg="??????,??? ..."/>
</Click>
</AjaxEvents>
<ToolTips>
<ext:ToolTip ID="ToolTip3" runat="server" Html="??????" />
</ToolTips>
</ext:ToolbarButton>
</Items>
</ext:Toolbar>
</TopBar>
</ext:Panel>
</North>
<West>
<ext:TreePanel ID="TreePanel1" runat="server" Width="200" Title="????" Icon="ChartOrganisation">
<Listeners>
<Click Handler="if(node.attributes.href){e.stopEvent();loadPage(#{Details}, node);}" />
</Listeners>
<Loader>
<ext:PageTreeLoader OnNodeLoad="LoadPages"></ext:PageTreeLoader>
</Loader>
</ext:TreePanel>
</West>
<Center>
<ext:TabPanel ID="Details" runat="server" EnableTabScroll="true">
</ext:TabPanel>
</Center>
</ext:BorderLayout>
</Body>
</ext:ViewPort>
</asp:Content>
the following was the Page_Load implement the data bind
Code:
this.Details.Header = true;
this.Details.FieldLabel = group.G_CName;
string url = "Render.aspx?GroupID=" + groupID.ToString();
LoadConfig load_config = new LoadConfig(url, LoadMode.IFrame, false);
Details.LoadContent(load_config);
</PRE></PRE>
RE: load the tabpanel to dynamic title, But the title not show?
Hi,
You need create Tab, add to the TabPanel and load page into the Tab. But you load into thye TabPanel. It is incorrect.
Please note that you can't create Tab during AjaxEvent therefore you must create tab using javascript