<ext:PageManager AutoSizePanelID="BorderLayout1" runat="server"></ext:PageManager> <ext:BorderLayout ID="BorderLayout1" ShowBorder="false" runat="server"> <Regions> <ext:Region ID="Region1" Height="60px" ShowBorder="false" ShowHeader="false" Position="Top" Layout="Fit" runat="server"> <Toolbars> <ext:Toolbar ID="Toolbar1" Position="Bottom" runat="server"> <Items> <ext:Button ID="btnExpandAll" IconUrl="~/images/expand-all.gif" Text="Expand All" EnablePostBack="false" runat="server"> </ext:Button> <ext:Button ID="btnCollapseAll" IconUrl="~/images/collapse-all.gif" Text="Collapse All" EnablePostBack="false" runat="server"> </ext:Button> <ext:ToolbarSeparator ID="ToolbarSeparator1" runat="server"> </ext:ToolbarSeparator> <ext:Button ID="btnCriticalErrors" IconUrl="~/images/exclamation.png" Text="Only Critical Errors" OnClick="btnCriticalErrors_Click" EnablePress="true" runat="server"> </ext:Button> </Items> </ext:Toolbar> </Toolbars> <Items> <ext:ContentPanel ShowBorder="false" ShowHeader="false" BodyStyle="background-color:#1C3E7E;" ID="ContentPanel1" runat="server"> <div style="font-size: 20px; color:White; font-weight:bold; padding: 3px 10px; "> <a href="./default.aspx" style="color:White;">Ext4JSLint</a> </div> </ext:ContentPanel> </Items> </ext:Region> <ext:Region ID="regionLeft" Split="true" Width="200px" ShowHeader="false" EnableCollapse="true" Layout="Fit" Position="Left" runat="server"> <Items> <ext:Tree runat="server" ID="Tree1" ShowBorder="false" ShowHeader="false" AutoScroll="true" EnableArrows="true" OnNodeCommand="Tree1_NodeCommand"> </ext:Tree> </Items> </ext:Region> <ext:Region ID="regionCenter" ShowHeader="false" Position="Center" Layout="Fit" runat="server"> <Items> <ext:Grid ID="Grid1" runat="server" ShowBorder="false" ShowHeader="false" EnableCheckBoxSelect="false" EnableRowNumber="false" EnableMultiSelect="false" OnRowDataBound="Grid1_RowDataBound" OnPreRowDataBound="Grid1_PreRowDataBound" Title="Grid"> <Columns> <ext:BoundField DataField="line" Width="45px" HeaderText="Line" /> <ext:BoundField DataField="reason" ExpandUnusedSpace="true" HeaderText="Reason" /> </Columns> </ext:Grid> </Items> </ext:Region> <ext:Region ID="regionRight" ShowHeader="false" Split="true" IFrameUrl="./source.htm" EnableIFrame="true" IFrameName="main" Position="Right" Width="400px" runat="server"> </ext:Region> </Regions> </ext:BorderLayout>
function onReady() { expandCollapseTree(); } function expandCollapseTree() { var tree = Ext.getCmp("<%= Tree1.ClientID %>"); var btnExpandAll = Ext.getCmp("<%= btnExpandAll.ClientID %>"); btnExpandAll.on("click", function() { tree.expandAll(); }); var btnCollapseAll = Ext.getCmp("<%= btnCollapseAll.ClientID %>"); btnCollapseAll.on("click", function() { tree.collapseAll(); }); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { LoadData(true); } } private void LoadData(bool showAllErrors) { btnExpandAll.OnClientClick = Tree1.GetExpandAllNodesReference(); btnCollapseAll.OnClientClick = Tree1.GetCollapseAllNodesReference(); }
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛