New dropdown implementation beside "Fontsize" drop down.

Last post 06-18-2009, 5:38 AM by Kenneth. 1 replies.
Sort Posts: Previous Next
  •  06-18-2009, 4:48 AM 53245

    New dropdown implementation beside "Fontsize" drop down.

    Hi,
     
       How to Add a new drop down say "Merge Fields" to beside Fontsize drop down.  When i select the new dropdown the text selected in the dropdown should be placed in cuteeditor. I have copy and pasted the fontsize dropdown and found a dropdown but when i tried to select the item in it javascript error has been raised. saying that not supported or implemented. Can u please suggest where to implement the javascript to bind the dropdown item in cuteeditor and how to implement it.
     
     
    Thanks & regards,
    T.sasi Kiran
  •  06-18-2009, 5:38 AM 53248 in reply to 53245

    Re: New dropdown implementation beside "Fontsize" drop down.

    Hi kiranthatiparthi,
     
    Try this example
     
    1. <%@ Page Language="C#" %>   
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>   
    4. <html>   
    5. <head>   
    6.     <title>test</title>   
    7. </head>   
    8. <body>   
    9.     <form id="Form1" runat="server">   
    10.         <CE:Editor ID="Editor1" Height="200" runat="server" TemplateItemList="Bold,Italic,Underline, insertcustombutonhere">   
    11.         </CE:Editor>   
    12.     </form>   
    13. </body>   
    14. </html>   
    15.   
    16. <script runat="server">   
    17.     void Page_Load(object sender, System.EventArgs e)   
    18.     {   
    19.         CuteEditor.ToolControl tc = Editor1.ToolControls["insertcustombutonhere"];   
    20.         if (tc != null)   
    21.         {   
    22.             DropDownList postbutton = new DropDownList();   
    23.             postbutton.Attributes["onclick"] = "selectValue(this)";   
    24.             postbutton.Items.Add("1");   
    25.             postbutton.Items.Add("2");   
    26.             postbutton.Items.Add("3");   
    27.             tc.Control.Controls.Add(postbutton);   
    28.         }   
    29.     }   
    30.   
    31. </script>   
    32.   
    33. <script language="JavaScript" type="text/javascript">   
    34.     var   time   =   1;      
    35.     function   selectValue(it)    
    36.       {      
    37.          time   =   time?0:1;      
    38.          if(time)      
    39.          {      
    40.          alert(it.value);    
    41.          // execute command like   
    42.          // var editor1=document.getElementById("<%=Editor1.ClientID%>");   
    43.         // editor1.ExecCommand("InsertImage");   
    44.          }      
    45.       }    
    46. </script>  

    Regards,
     
    ken
View as RSS news feed in XML