"AutoHeight"、"AutoWidth" issue

2 replies. Last post: September 16, 2010 2:00 AM by Frank Bruce
Tags :
  • New Discussion
  • New Question
  • New Product Feedback
Frank BruceMember

question 1:
IntersoftWebForm.aspxwhen I set AutoHeight="true" ,the page Will display wrong(webtabAutoHeight=true.png),but when I set Hight="550px",the page display right!But I want to let pabPanel has self-adaption of height when brower changs height!how to do?

IntersoftWebForm.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="IntersoftWebForm.aspx.cs" Inherits="IntersoftWebForm" %> <%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %> <%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head runat="server"> <title>TabPanel does not have self-adaption of height</title> </head> <body> <form id="form1" runat="server"> <ext:ScriptManager ID="ScriptManager1" runat="server" HideInDesign="true" /> <ext:TabPanel ID="TabPanel1" runat="server" AutoHeight="true" AutoWidth="true" Border="true"> <CustomConfig> <ext:ConfigItem Name="monitorResize" Value="true" Mode="Raw" Encode="False"> </ext:ConfigItem> </CustomConfig> </ext:TabPanel> </form> </body> </html>
question 2:
I have a page  Grid3.aspx, the webgrids of the page has self-adaption of height 
and width.but when I put Grid3.aspx into TabPanel,it will display wrong(tab1.png\tab2.png\tab3.png).strangely,the Grid3.aspx has not self-adaption of  width at this time.
how to do??
 


index.aspx:
<td style="height: 100%; width: auto" valign="top">
<iframe id="main" name="main" scrolling="yes" style="width: 100%; height: 100%" frameborder="0" src="MainPage.aspx"></iframe> </td>










 

 
MainPage.aspx:
<body oncontextmenu="return false" style="overflow: hidden;">
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" HideInDesign="True" />
    </form>
    <div id="divtab" runat="server" >
<%--When I set "AutoHeight="true"" instead of  "Height="800px"",page runs wrong,you can try --%>
        <ext:TabPanel ID="TabPanel1" runat="server"   Height="430px"   AutoWidth="true"  EnableTabScroll="true" 
        AutoScroll="true"    Border="false" AnimScroll="true">
            <CustomConfig>
<ext:ConfigItem Name="monitorResize" Value="true" Mode="Raw" Encode="False"></ext:ConfigItem>
</CustomConfig>
        </ext:TabPanel>
    </div>

   <script type="text/javascript">     
        function findDimensions() {           
             document.getElementById("divtab").style.height = (document.documentElement.clientHeight - 10) + "px";
               var TabPanels = Ext.getCmp("TabPanel1");
               TabPanels.setWidth(document.documentElement.clientWidth-10);
  
        }
        function setTabHeight(heig) {
            document.getElementById("divtab").style.height = heig;
        }
        window.onresize = findDimensions;

        function addTabMain(id, url, Titel, close) {
            var TabPanels = Ext.getCmp("TabPanel1");
            //TabPanels.setHeight(Ext.get("divtab").getComputedHeight());           
            var tab = TabPanels.getComponent(id);
            for (var i = 0; i < TabPanels.items.length; i++) {
                if (TabPanels.items.items[i].title == Titel) {
                    TabPanels.activate(TabPanels.items.items[i]);
                    return;
                }
            }
            if (url.indexOf('?') == -1) url = url + '?a=1';
            if (!tab) {
                if (TabPanels.items.getCount() > 11) {
                    alert("只允许同时打开12个标签页,请关闭一些后重试!");
                }
                else {
                    tab = TabPanels.add({
                        id: id,
                        title: Titel,
                        closable: close,
                        border: false,
                        autoLoad: {
                            showMask: true,
                            url: url + '&sid=' + id,
                            mode: 'iframe',
                           maskMsg: '正在加载页面,请稍侯...'
                        }
                    });
                }
            }
            TabPanels.setActiveTab(tab);
        }

    </script>

</body>
 
Grid3.aspx:
 
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Grid3.aspx.cs" Inherits="TestGridPage_Grid3" %>

<%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %>
<%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop"
    TagPrefix="ISWebDesktop" %>
<%@ Register assembly="ISNet.WebUI.WebInput" namespace="ISNet.WebUI.WebControls" tagprefix="ISWebInput" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head runat="server">
    <title></title>
    <script>
       function RefreshGrid() {
            var grid1 = ISGetObject("WebGrid1");
            var grid2 = ISGetObject("WebGrid2");
            var grid3 = ISGetObject("WebGrid3");
            grid1.Refresh();
            grid2.Refresh();
            grid3.Refresh();
           
        }
     </script>
</head>
<body style="background-color: #DFE8F7; margin: 0px; font-size: 11px; overflow: hidden;"
    oncontextmenu="return false">
    <form id="form1" runat="server">
    <div>
    <ISWebDesktop:WebToolBar ID="WebToolBar1" runat="server" Caption="WebToolBar1" 
        CommandSize="" HeaderHeight="" IntegratedTo="None" NewDockingArea="NotSet"  
        NewDockingRow="0" NewIsFloat="Default" Width="100%">
        <Commands>
            <ISWebDesktop:ToolCommand Category="WebToolBar1" Name="ToolCommand0" Text="打开" >
            </ISWebDesktop:ToolCommand>
            <ISWebDesktop:ToolCommand Category="WebToolBar1" Name="ToolCommand1" Text="编辑">
            </ISWebDesktop:ToolCommand>
            <ISWebDesktop:ToolCommand Category="WebToolBar1" Name="ToolCommand2" Text="新增">
            </ISWebDesktop:ToolCommand>
            <ISWebDesktop:ToolCommand Category="WebToolBar1" Name="ToolCommand3" Text="修改">
            </ISWebDesktop:ToolCommand>
            <ISWebDesktop:ToolCommand Category="WebToolBar1" Name="ToolCommand4" Text="删除">
            </ISWebDesktop:ToolCommand>
        </Commands>
    </ISWebDesktop:WebToolBar>

    <table style="font-size: 12px;">
        <tr style="height: 5px">
            <td width="80px" align="left">
                起始日期:
            </td>
            <td width="160px" align="left">
                <ISWebInput:WebInput ID="WebInput1" runat="server">
                </ISWebInput:WebInput>
            </td>
            <td width="80px" align="left">
                终止日期:
            </td>
            <td width="160px" align="left">
                <ISWebInput:WebInput ID="WebInput2" runat="server" DecimalSeparator="" MaxDate="12/31/9998 23:59:59"
                    MinDate="1753-01-01">
                    <EditFormat>
                        <ErrorWindowInfo IsEnabled="False">
                        </ErrorWindowInfo>
                    </EditFormat>
                    <DateTimeEditor DateInputLink="">
                        <DropDownYearFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderWidth="1px">
                        </DropDownYearFrameStyle>
                        <DropDownMonthFrameStyle BackColor="#FFFFFF" BorderColor="Black" BorderWidth="1px">
                        </DropDownMonthFrameStyle>
                        <QuickSelectDateIconStyle Height="18px" Width="20px">
                        </QuickSelectDateIconStyle>
                    </DateTimeEditor>
                    <CultureInfo CultureName="zh-CN">
                    </CultureInfo>
                    <DisplayFormat Format="MM/dd/yy HH:mm" IsEnabled="True">
                    </DisplayFormat>
                </ISWebInput:WebInput>
            </td>
            <td>
            </td>
        </tr>
        <tr>
            <td width="90px" align="left" class="style1">
                供应商编号:
            </td>
            <td width="160px" align="left" class="style1">
                <input id="ledCompanyNo" runat="server" style="width: 135px; height: 18px;" type="text"
                    class="igtxt_Office2007BlueEdit" />
            </td>
            <td width="80px" align="left" class="style1">
                供应商名称:
            </td>
            <td width="160px" align="left" class="style1">
                <input id="ledCompanyName" runat="server" style="width: 220px; height: 18px;" type="text"
                    class="igtxt_Office2007BlueEdit" />
            </td>
            <td class="style1">
                 
            </td>
        </tr>
        <tr style="height: 2px">
            <td>
            </td>
        </tr>
    </table>
           <h4> 多个Tab页面宽度无法自适应</h4>
        <h4>
            Tab高度无法自适应</h4>
        <ISWebDesktop:WebTab ID="WebTab1" runat="server" Height="380px" Width="100%">  
        <ClientSideEvents  OnAfterTabChanged="RefreshGrid()"/>         
            <TabPages>            
                <ISWebDesktop:WebTabItem Text="Tab 1">
                    <PageTemplate>
                    <%-- Width="90.2%" Height="100%"--%>
                        <ISWebGrid:WebGrid ID="WebGrid1" runat="server" UseDefaultStyle="True"
                            DefaultStyleMode="Win7" DataSourceID="SqlDataSource1">
                            <LayoutSettings StatusBarVisible="true" AutoHeight="true" AutoWidth="true"   PagingMode="ClassicPaging" PagingSize="12"  >
                            </LayoutSettings>
                            <RootTable DataKeyField="CustomerID">
                                <Columns>
                                    <ISWebGrid:WebGridColumn Caption="CustomerID" DataMember="CustomerID" Name="CustomerID"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="CompanyName" DataMember="CompanyName" Name="CompanyName"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="ContactName" DataMember="ContactName" Name="ContactName"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="ContactTitle" DataMember="ContactTitle" Name="ContactTitle"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Address" DataMember="Address" Name="Address" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="City" DataMember="City" Name="City" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Region" DataMember="Region" Name="Region" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="PostalCode" DataMember="PostalCode" Name="PostalCode"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Country" DataMember="Country" Name="Country" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Phone" DataMember="Phone" Name="Phone" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Fax" DataMember="Fax" Name="Fax" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                </Columns>
                            </RootTable>
                        </ISWebGrid:WebGrid>
                    </PageTemplate>
                </ISWebDesktop:WebTabItem>
                <ISWebDesktop:WebTabItem Text="Tab 2">
                    <PageTemplate>
                        <ISWebGrid:WebGrid ID="WebGrid2" runat="server" UseDefaultStyle="True" 
                            DefaultStyleMode="Win7" DataSourceID="SqlDataSource1">
                            <LayoutSettings AutoHeight="true" AutoWidth="true"   PagingMode="ClassicPaging" PagingSize="12" >                    
                            </LayoutSettings>
                            <RootTable DataKeyField="CustomerID">
                                <Columns>
                                    <ISWebGrid:WebGridColumn Caption="CustomerID" DataMember="CustomerID" Name="CustomerID"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="CompanyName" DataMember="CompanyName" Name="CompanyName"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="ContactName" DataMember="ContactName" Name="ContactName"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="ContactTitle" DataMember="ContactTitle" Name="ContactTitle"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Address" DataMember="Address" Name="Address" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="City" DataMember="City" Name="City" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Region" DataMember="Region" Name="Region" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="PostalCode" DataMember="PostalCode" Name="PostalCode"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Country" DataMember="Country" Name="Country" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Phone" DataMember="Phone" Name="Phone" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Fax" DataMember="Fax" Name="Fax" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                </Columns>
                            </RootTable>
                        </ISWebGrid:WebGrid>
                    </PageTemplate>
                </ISWebDesktop:WebTabItem>
                <ISWebDesktop:WebTabItem Text="Tab 3">
                    <PageTemplate>
                        <ISWebGrid:WebGrid ID="WebGrid3" runat="server" UseDefaultStyle="True" 
                            DefaultStyleMode="Win7" DataSourceID="SqlDataSource1">
                            <LayoutSettings AutoHeight="true" AutoWidth="true"  PagingMode="ClassicPaging" PagingSize="12" >          
                            </LayoutSettings>
                            <RootTable DataKeyField="CustomerID">
                                <Columns>
                                    <ISWebGrid:WebGridColumn Caption="CustomerID" DataMember="CustomerID" Name="CustomerID"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="CompanyName" DataMember="CompanyName" Name="CompanyName"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="ContactName" DataMember="ContactName" Name="ContactName"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="ContactTitle" DataMember="ContactTitle" Name="ContactTitle"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Address" DataMember="Address" Name="Address" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="City" DataMember="City" Name="City" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Region" DataMember="Region" Name="Region" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="PostalCode" DataMember="PostalCode" Name="PostalCode"
                                        Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Country" DataMember="Country" Name="Country" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Phone" DataMember="Phone" Name="Phone" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                    <ISWebGrid:WebGridColumn Caption="Fax" DataMember="Fax" Name="Fax" Width="100px">
                                    </ISWebGrid:WebGridColumn>
                                </Columns>
                            </RootTable>
                        </ISWebGrid:WebGrid>
                    </PageTemplate>
                </ISWebDesktop:WebTabItem>
            </TabPages>
            <TabItemStyle>
                <Normal Cursor="Hand" BackColor="Gainsboro" BorderColor="Gray" BorderStyle="Solid"
                    BorderWidth="1px" Font-Bold="False" Font-Italic="False" Font-Names="Tahoma" Font-Size="8pt"
                    Font-Underline="False" Height="100%" Width="100%">
                    <Padding Top="2px" Left="10px" Right="10px" Bottom="0px"></Padding>
                </Normal>
                <Over BaseStyle="Normal" BackColor="WhiteSmoke">
                </Over>
                <Active GradientType="Vertical" BackColor2="245, 245, 245" BaseStyle="Normal" BackColor="White"
                    BorderColor="Navy" BorderStyle="Solid" BorderWidth="1px">
                </Active>
            </TabItemStyle>
        </ISWebDesktop:WebTab>
    </div>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
        SelectCommand="SELECT * FROM [Customers]"></asp:SqlDataSource>
    </form>
</body>
</html>
  

 

 I can not upload all the code(12M) ,Please help me  let the webgrid have self-adaption of height and width in some cases!

  it is very urgent      thanks!


 


 

 

 

 

 

 

 

 

 

 

 

 

1 attachment
All times are GMT -5. The time now is 3:39 AM.
Previous Next