Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: CuteEditor_OnInitialized(editor) doesn't work when ajax call back in the tab panel
Re: CuteEditor_OnInitialized(editor) doesn't work when ajax call back in the tab panel
03-29-2010, 2:04 AM
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: CuteEditor_OnInitialized(editor) doesn't work when ajax call back in the tab panel
Reply
Quote
hi
wolf11th
,
Try
<%@ Page Language=
"C#"
%>
<%@ Register Assembly=
"AjaxControlToolkit"
Namespace=
"AjaxControlToolkit"
TagPrefix=
"cc1"
%>
<%@ Register Assembly=
"CuteEditor"
Namespace=
"CuteEditor"
TagPrefix=
"CE"
%>
<!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 runat=
"server"
>
<title>example</title>
</head>
<body>
<form id=
"form1"
runat=
"server"
>
<div>
<asp:ScriptManager ID=
"ScriptManager1"
runat=
"server"
>
</asp:ScriptManager>
<asp:UpdatePanel ID=
"UpdatePanel1"
runat=
"server"
>
<ContentTemplate>
<asp:Button ID=
"Button1"
runat=
"server"
Text=
"Do PostBack"
/>
<cc1:TabContainer ID=
"TabContainer1"
runat=
"server"
>
<cc1:TabPanel runat=
"server"
HeaderText=
"Surveyors Section"
ID=
"TabPanel1"
Height=
"100%"
>
<HeaderTemplate>
<div>
tab1</div>
</HeaderTemplate>
<ContentTemplate>
tab1 text
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel runat=
"server"
HeaderText=
"Surveyors Section"
ID=
"TabPanelSurveyor"
>
<HeaderTemplate>
tab2
</HeaderTemplate>
<ContentTemplate>
<div id=
"divSurveyor"
style=
"overflow: auto;"
>
<CE:Editor ID=
"Editor1"
runat=
"server"
Height=
"400"
ShowPreviewMode=
"False"
ResizeMode=
"None"
>
</CE:Editor>
</div>
</ContentTemplate>
</cc1:TabPanel>
<cc1:TabPanel runat=
"server"
HeaderText=
"Surveyors Section"
ID=
"TabPanel2"
>
<HeaderTemplate>
tab3
</HeaderTemplate>
<ContentTemplate>
<div id=
"div1"
style=
"overflow: auto;"
>
<CE:Editor ID=
"Editor2"
runat=
"server"
Height=
"400"
ShowPreviewMode=
"False"
ResizeMode=
"None"
>
</CE:Editor>
</div>
</ContentTemplate>
</cc1:TabPanel>
</cc1:TabContainer>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</body>
</html>
<script>
var e1=
false
;
var e2=
false
;
function CuteEditor_OnInitialized(editor)
{
var editor1=document.getElementById(
"<%= Editor1.ClientID %>"
);
var editor2=document.getElementById(
"<%= Editor2.ClientID %>"
);
switch
(editor.id) {
case
editor1.id:
editor1.SetHeight(
"1000"
);
e1=
true
;
break
;
case
editor2.id:
editor2.SetHeight(
"300"
);
e2=
true
;
break
;
}
}
//you can use the code below to change the editor size. but switch between tab will Activation function window.onresize
//window.onresize=function()
//{
//var editor1=document.getElementById("<%= Editor1.ClientID %>");
//var editor2=document.getElementById("<%= Editor2.ClientID %>");
//if(e1==true)
//{
// editor1.SetHeight("100");
//}
//if(e2==true)
//{
// editor2.SetHeight("200");
//}
//}
</script>
Regards,
Ken
View Complete Thread