Default页中框架代码如下 <%--左侧树--%>
<x:Region ID="regionLeft" Split="true" EnableSplitTip="true" CollapseMode="Default"
Icon="Outline" EnableCollapse="true" EnableLargeHeader="false" Width="200px"
ShowHeader="true" Title="系统菜单" Layout="Fit" Position="Left" runat="server"
EnableIFrame="true" IFrameName="leftframe" IFrameUrl="leftmenu.aspx">
</x:Region>
<%--右侧框架--%>
<x:Region ID="mainRegion" ShowHeader="false" Layout="Fit" Margins="0 0 0 0" Position="Center"
runat="server">
<Items>
<x:TabStrip ID="mainTabStrip" EnableTabCloseMenu="true" ShowBorder="false" runat="server">
<Tabs>
<x:Tab ID="Tab1" Title="首页" EnableIFrame="true" IFrameName="mainframe" IFrameUrl="index.aspx" Icon="House" runat="server">
</x:Tab>
</Tabs>
</x:TabStrip>
</Items>
</x:Region>
menul.xml中代码如下(红色字体为js脚本,我想动态添加标签使用):
<TreeNode Text="动态添加标签" SingleClickExpand="true">
<TreeNode Text="添加标签" OnClientClick="openHelloFineUI();"></TreeNode>
<TreeNode Text="模块1"></TreeNode>
<TreeNode Text="模块1"></TreeNode>
</TreeNode>
leftmenu页代码如下:
<form id="form1" runat="server">
<xageManager ID="ageManager1" AutoSizePanelID="leftAccordion" runat="server"></xageManager>
<x:Accordion runat="server" EnableFill="false" ShowBorder="false" ShowHeader="false" ID="leftAccordion"></x:Accordion>
<%--获取XML文件路径--%>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="../MenuData/menuMail.xml"></asp:XmlDataSource>
</form>
<script type="text/javascript">
var leftAccordionID = '<%= leftAccordion.ClientID %>';
function onReady() {
// // 默认加载第一个链接节点
// // 首先获取手风琴控件第一个面板中的树控件
// var tree = X(leftAccordionID).items.get(0).items.get(0);
// var treeFirstChild = tree.getRootNode().firstChild;
//
// // 选中第一个链接节点,并在右侧IFrame中打开此链接
// treeFirstChild.select();
// parent.window.frames['mainframe'].location.href = treeFirstChild.attributes['href'];
}
function openHelloFineUI() {
alert('2')/*
var node = {
attributes: {
href: "/basic/hello.aspx"
},
text: "你好 FineUI",
id: "hello_fineui_example"
};
*/
mainTabStrip.GetAddTabReference("dynamic_tab_baidu1", "http://www.baidu.com/", "Baidu1", IconHelper.GetIconUrl(Icon.Application), true);
}
</script>
使用红字体js无法添加是为啥?
请大家帮忙解答!!!!!
|