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

[Solved] Multiple custom buttons?

1 Answer 126 Views
Editor
This is a migrated thread and some comments may be shown as answers.
abdu bukres
Top achievements
Rank 1
abdu bukres asked on 30 Apr 2008, 06:57 AM
I have 2 questions:
1- Can multiple custom buttons be added to the toolbar?
2- Can a button be programmed to parse and modify the html through Javascript?


1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 30 Apr 2008, 12:07 PM
Hello Abdu,

Straight to the questions:
  1. Yes, it is possible. You can see how to add a custom button in the following help article: Adding Your Own Buttons.
  2. Each custom button has a javascript command which allows you to execute javascript code, e.g.

    <script type="text/javascript">
    Telerik.Web.UI.Editor.CommandList["Custom1"] = function(commandName, editor, args)
    {
      
    alert("Custom command 1");
       //here you can obtain the editor content with
       editor.get_html(true);
       //parse it with your own code and paste it or set it back in the content area with
       editor.pasteHtml("modified content"); //editor.set_html("modified
    content");
    }
    ;
Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
abdu bukres
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or