This is a migrated thread and some comments may be shown as answers.

EditorDropDown issues

2 Answers 80 Views
Editor
This is a migrated thread and some comments may be shown as answers.
dan
Top achievements
Rank 1
dan asked on 16 Feb 2009, 01:45 PM
hello i am using EditorDropDown but i kip getting this error "the command InsertEmoticon is not implemented yet.
this is my code please help me

EditorDropDown InsertEmoticon = new EditorDropDown("InsertEmoticon"); 
                InsertEmoticon.Text = "Dynamic dropdown"
 
                //Set the popup width and height 
                InsertEmoticon.Attributes["width"] = "110px"; 
                InsertEmoticon.Attributes["popupwidth"] = "240px"; 
                InsertEmoticon.Attributes["popupheight"] = "100px"; 
                                
                for (int i = 1; i < 94; i++) 
                { 
                    InsertEmoticon.Items.Add(new EditorDropDownItem("<IMG SRC='pages/emoticons/"+i+".gif' />", "pages/emoticons/"+i+".gif")); 
                    
                } 
                main.Tools.Add(InsertEmoticon); 
                //main.Tools.Add(InsertEmoticon);   
                editor.OnClientCommandExecuted = "OnClientCommandExecuting"
               string script = "function OnClientCommandExecuting(editor, args)" + 
               "{" + 
                   "var name = args.get_name();" + 
               "var val = args.get_value();" + 
               "if (name == 'InsertEmoticon'){" + 
               "editor.pasteHtml('<img src=\"' + val + '\"/>');" + 
               "args.set_cancel(true);" + 
               "}" + 
               "}"; 
 
                Page.ClientScript.RegisterStartupScript(this.GetType(), "InsertEmoticon", script, true); 

2 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 19 Feb 2009, 09:00 AM
Hi Dan,

You have attached the OnClientCommandExecuting function to the editor.OnClientCommandExecuted event, but you should attach it to the editor.OnClientCommandExecuting event, which is fired before the command execution. This should fix the problem.

For your convenience I have attached my test page and its codebehind file.

Best regards,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
dan
Top achievements
Rank 1
answered on 19 Feb 2009, 09:20 AM

I am sorry on my stupid mistake I'm embarrassed

Thank you very much on your help

Tags
Editor
Asked by
dan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
dan
Top achievements
Rank 1
Share this question
or