是不是Tree的BUG?

Dec 21, 2010 at 5:01 AM

代码如下,当点击按钮“保存时”,将会报 错误: 'getRootNode().childNodes' 为空或不是对象。

但是当把Tab中的tree去掉时,错误消失。

 

请教解决方法,谢谢!

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!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></title>
</head>
<body>
<form id="form1" runat="server">
    <ext:PageManager ID="PageManager1" AutoSizePanelID="RegionPanel1" HideScrollbar="true" runat="server"/>
    <ext:RegionPanel ID="RegionPanel1" runat="server" ShowBorder="False">   
        <Regions>
        <ext:Region ID="region1" ShowBorder="false" ShowHeader="false" Position="Top" Layout="Fit" runat="server">
            <Toolbars>
                <ext:Toolbar ID="Toolbar3" Position="Bottom" runat="server">
                <Items>
                    <ext:Button ID="btnSaveClose" Icon="SystemSaveClose" runat="server" Text="保存">
                    </ext:Button>
                    <ext:ToolbarSeparator ID="ToolbarSeparator3" runat="server">
                    </ext:ToolbarSeparator>
                    <ext:Button ID="btnClose" Icon="SystemClose" EnablePostBack="false" runat="server" Text="关闭">
                    </ext:Button>
                </Items>
                </ext:Toolbar>
            </Toolbars>
        </ext:Region>
            <ext:Region runat="server" ID="TableRegion" Position="Center" Layout="Fit" Margins="0 0 0 0" ShowHeader="false">
                <Items>
                    <ext:TabStrip ID="MainTable" runat="server" EnableTabCloseMenu="true"  ShowBorder="false">
                        <Tabs>
                            <ext:Tab ID="Tab1" Layout="Fit" runat="server" BodyPadding="5px" EnableBackgroundColor="true" Title="Tab1">
                                <Items>
                                    <ext:Form ID="SimpleForm1" runat="server" EnableBackgroundColor="true" ShowHeader="false">
                                    <Rows>
                                        <ext:FormRow ID="FormRow1" runat="server">
                                            <Items>
                                            <ext:TextBox Required="true" ID="txtUsername" runat="server" Label="用户名" Text=""/>
                                            </Items>
                                        </ext:FormRow>
                                    </Rows>
                                    </ext:Form>
                                </Items>
                            </ext:Tab>
                           
                            <ext:Tab ID="Tab2" runat="server" EnableBackgroundColor="true" Title="树Tab">
                                <Items>
                                <ext:SimpleForm ID="SimpleForm2" runat="server" EnableBackgroundColor="true" ShowHeader="false">
                                    <Items>
                                    <ext:Tree ID="treeMenu" EnableArrows="true" ShowBorder="false"  ShowHeader="false" runat="server" >
                                    </ext:Tree>
                                    </Items>
                                </ext:SimpleForm>
                                </Items>
                            </ext:Tab>
                        </Tabs>
                    </ext:TabStrip>
                </Items>
            </ext:Region>
        </Regions>
    </ext:RegionPanel>
</form>
</body>
</html>