Re: CuteEditor_OnInitialized(editor) doesn't work when ajax call back in the tab panel

  •  03-29-2010, 2:04 AM

    Re: CuteEditor_OnInitialized(editor) doesn't work when ajax call back in the tab panel

    hi wolf11th ,
     
    Try
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>   
    4. <%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="CE" %>   
    5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">   
    6.   
    7. <html xmlns="http://www.w3.org/1999/xhtml">   
    8. <head runat="server">   
    9.     <title>example</title>   
    10. </head>   
    11. <body>   
    12.     <form id="form1" runat="server">   
    13.     <div>   
    14.         <asp:ScriptManager ID="ScriptManager1" runat="server">   
    15.         </asp:ScriptManager>   
    16.         <asp:UpdatePanel ID="UpdatePanel1" runat="server">   
    17.             <ContentTemplate>   
    18.                 <asp:Button ID="Button1" runat="server" Text="Do PostBack" />   
    19.                 <cc1:TabContainer ID="TabContainer1" runat="server">   
    20.                     <cc1:TabPanel runat="server" HeaderText="Surveyors Section" ID="TabPanel1" Height="100%">   
    21.                         <HeaderTemplate>   
    22.                             <div>   
    23.                                 tab1</div>   
    24.                         </HeaderTemplate>   
    25.                         <ContentTemplate>   
    26.                             tab1 text   
    27.                         </ContentTemplate>   
    28.                     </cc1:TabPanel>   
    29.                     <cc1:TabPanel runat="server" HeaderText="Surveyors Section" ID="TabPanelSurveyor">   
    30.                         <HeaderTemplate>   
    31.                             tab2   
    32.                         </HeaderTemplate>   
    33.                         <ContentTemplate>   
    34.                             <div id="divSurveyor" style="overflow: auto;">   
    35.                                 <CE:Editor ID="Editor1" runat="server" Height="400" ShowPreviewMode="False" ResizeMode="None">   
    36.                                 </CE:Editor>   
    37.                             </div>   
    38.                         </ContentTemplate>   
    39.                     </cc1:TabPanel>   
    40.                     <cc1:TabPanel runat="server" HeaderText="Surveyors Section" ID="TabPanel2">   
    41.                         <HeaderTemplate>   
    42.                             tab3   
    43.                         </HeaderTemplate>   
    44.                         <ContentTemplate>   
    45.                             <div id="div1" style="overflow: auto;">   
    46.                                 <CE:Editor ID="Editor2" runat="server" Height="400" ShowPreviewMode="False" ResizeMode="None">   
    47.                                 </CE:Editor>   
    48.                             </div>   
    49.                         </ContentTemplate>   
    50.                     </cc1:TabPanel>   
    51.                 </cc1:TabContainer>   
    52.             </ContentTemplate>   
    53.         </asp:UpdatePanel>   
    54.     </div>   
    55.     </form>   
    56. </body>   
    57. </html>   
    58.   
    59. <script>   
    60. var e1=false;   
    61. var e2=false;   
    62. function CuteEditor_OnInitialized(editor)   
    63.   
    64. {   
    65. var editor1=document.getElementById("<%= Editor1.ClientID %>");   
    66. var editor2=document.getElementById("<%= Editor2.ClientID %>");   
    67.   
    68. switch (editor.id) {    
    69. case editor1.id:    
    70.   editor1.SetHeight("1000");   
    71.   e1=true;   
    72.   
    73. break;    
    74. case editor2.id:    
    75. editor2.SetHeight("300");    
    76. e2=true;   
    77. break;    
    78. }    
    79.   
    80. }   
    81. //you can use the code below to change the editor size. but switch between tab will Activation function window.onresize   
    82. //window.onresize=function()   
    83. //{   
    84.   
    85. //var editor1=document.getElementById("<%= Editor1.ClientID %>");   
    86. //var editor2=document.getElementById("<%= Editor2.ClientID %>");   
    87. //if(e1==true)   
    88. //{   
    89. //  editor1.SetHeight("100");   
    90. //}   
    91.   
    92. //if(e2==true)   
    93. //{   
    94. //  editor2.SetHeight("200");   
    95. //}   
    96. //}   
    97. </script>  
    Regards,
     
    Ken
View Complete Thread