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

[Solved] Set ToolbarMode from JavaScript

1 Answer 76 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Lindsay
Top achievements
Rank 2
Lindsay asked on 20 Aug 2009, 04:31 PM
Is it possible to set the Toolbar mode from javascript?  I'm having a ton of issues with resizing the editor with the mode is default for smaller sizes.  My solution is to have the editor have the toolbarmode to PageTop when the user has a small screen resolution, but I can only find this out with javascript.  I want it to be "default" for users that can see that much on the screen at one time, and "pagetop" for those with smaller resolutions.

Any suggestions?

thx!

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 25 Aug 2009, 11:18 AM
Hi Lindsay,

The requested functionality is not supported by RadEditor on the client.
If you would like you can try the following hack to achieve your goal on the client but please note that Telerik does not support it, because the set_toolbarMode() method is not part of the public RadEditor's Client-Side API:

<telerik:RadEditor ID="RadEditor1" OnClientInit="OnClientInit" runat="server"></telerik:RadEditor>  
<script type="text/javascript"
function OnClientInit(editor) 
    var pageTop = Telerik.Web.UI.EditorToolbarMode.PageTop; 
    editor.set_toolbarMode(pageTop); 
                          
    if ($telerik.isIE) return
    setTimeout(function() 
    { 
        editor.pasteHtml(""); 
    }, 1000); 
</script> 


Kind 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.
Tags
Editor
Asked by
Lindsay
Top achievements
Rank 2
Answers by
Rumen
Telerik team
Share this question
or