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

editor.fire command

4 Answers 194 Views
Editor
This is a migrated thread and some comments may be shown as answers.
vladimir
Top achievements
Rank 1
vladimir asked on 17 Oct 2008, 10:11 AM
Hi,
I am trying to add several custom buttons, but still have the problems with calling the editor.fire function. It works perfectly for some primitive functions like Bold, JustifyLeft etc. and it's well documented. But I spent a lot of time searching the proper syntax for setting the ForeColor property (the result was 

Telerik.Web.UI.Editor.CommandList[

"Blue"] = function(commandName, editor, args) { editor.fire("ForeColor", { value: "#2e2e6c" }); };

 

Now I am in the same position when trying to fire the FlashManager dialog. While Telerik.Web.UI.Editor.CommandList["InsertPicture"] = function(commandName, editor, args) { editor.fire("ImageManager"); }; works well, the similar Telerik.Web.UI.Editor.CommandList["InsertFlash"] = function(commandName, editor, args) { editor.fire("FlashManager"); }; shows the error message "Dialog parameters for the FlashDialog doesn't exist". Could you tell me the proper syntax?

And another question. Is it possible to hide the "EditModes" buttons at the bottom line (e.g. via css .rade_editorModesCell {display: none !important;}) and invoke the change of the EditMode by clicking my custom buttons (similar to calling javascript editor.fire function)?

4 Answers, 1 is accepted

Sort by
0
vladimir
Top achievements
Rank 1
answered on 17 Oct 2008, 10:33 AM
Weird, don't know why, but works

<telerik:EditorToolGroup>
      <telerik:EditorTool Name="myInsertFlash" Text="Insert flash" />
       <telerik:EditorTool Name="FlashManager" Text="Insert flash" Visible="false" />
    </telerik:EditorToolGroup>
0
Lini
Telerik team
answered on 17 Oct 2008, 11:34 AM
Hi,

The editor renders only the tools that it needs on the page in order to minimize its HTML and JavaScript footprint. If the FlashManager tool is not added in the toolbar, then the editor will not render the additional scripts/parameters it needs to open the tool, so it will not be possible to call it with the .fire() method. After you have added the tool to the toolbar (even though it is visible="false"), it will be available on the client and you will be able to call it programmatically.

About your second question - try using the set_mode() method to set the EditMode on the client: http://www.telerik.com/help/aspnet-ajax/editor_set_mode.html

Regards,
Lini
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Steve Napurano
Top achievements
Rank 1
answered on 04 Jun 2011, 08:59 PM
broken link I NEED the answer to hiding the editmode toolbar on bottom all together.
The radeditor is readonly on my page
0
Rumen
Telerik team
answered on 07 Jun 2011, 02:22 PM
Hi Steve Napurano,

Here is the new link: http://www.telerik.com/help/aspnet-ajax/editor-set-mode.html

All the best,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Editor
Asked by
vladimir
Top achievements
Rank 1
Answers by
vladimir
Top achievements
Rank 1
Lini
Telerik team
Steve Napurano
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or