Custom Button Error

Last post 07-17-2009, 2:22 PM by rrowles2000. 1 replies.
Sort Posts: Previous Next
  •  07-17-2009, 7:28 AM 54058

    Custom Button Error

    Hi,
     
    Im getting "Command 'OnCommand' is not supported or not implemented" with the following code. Any ideas plz?
     
    1. editor.CustomAddons = "<img title=""Using oncommand"" class=""CuteEditorButton"" onmouseover=""CuteEditor_ButtonCommandOver(this)"" onmouseout=""CuteEditor_ButtonCommandOut(this)"" onmousedown=""CuteEditor_ButtonCommandDown(this)"" onmouseup=""CuteEditor_ButtonCommandUp(this)"" ondragstart=""CuteEditor_CancelEvent()"" Command=""OnCommand"" src=""../htmlEditor/CuteEditor_Files/Images/add-image-icon.gif"" />"&_   
    2.                       "<img title=""Using oncommand"" class=""CuteEditorButton"" onmouseover=""CuteEditor_ButtonCommandOver(this)"" onmouseout=""CuteEditor_ButtonCommandOut(this)"" onmousedown=""CuteEditor_ButtonCommandDown(this)"" onmouseup=""CuteEditor_ButtonCommandUp(this)"" ondragstart=""CuteEditor_CancelEvent()"" Command=""OnCommand"" src=""../htmlEditor/CuteEditor_Files/Images/link.gif"" />"  
    3.                
    4. editor.Width = 600   
    5. editor.Height = 240   
    6.   
    7. If request("postback") <> "true" then   
    8.   
    9.     editor.LoadHTML(myFile)   
    10.        
    11.     %>  
    1. <script language="JavaScript" type="text/javascript" >   
    2.     var editor1=document.getElementById("<%= editor.ClientID %>");   
    3.                  
    4.     function CuteEditor_OnCommand(editor,command,ui,value)   
    5.     {   
    6.         alert('hello');   
    7.         //handle the command by yourself   
    8.         if(command=="MyInsertLink")   
    9.         {   
    10.             //editor.ExecCommand("InsertTable");   
    11.             editor1.PasteHTML("Hello World");   
    12.             return true;   
    13.         }   
    14.     }   
    15. lt;/script>  
  •  07-17-2009, 2:22 PM 54072 in reply to 54058

    Re: Custom Button Error

    OK, it really helps to put the OnCommand js after drawing the editor. Missed that bit.
View as RSS news feed in XML