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

[Solved] Closing a 'ShowOnFocus' toolbar.

1 Answer 143 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Andy
Top achievements
Rank 1
Andy asked on 08 Jun 2009, 11:57 AM
I'm using Q3 2008 1105 and I want to add an 'X-to-close' button onto the 'ShowOnFocus' toolbar, so that the user can get rid of the toolbar after they have finished editing by clicking a 'X' on the toolbar, rather than having to change the focus to a non-editable area.

I am okay with the process of adding the button but I cannot find any documentation showing a client-side method of hiding the toolbar.

I don't want to permanently remove the toolbar. I want it to re-appear if they click back on that editor area again.

This is the process for a user:

1) User clicks an editable area on the page.
2) Toolbar pops-up via 'showonfocus'.
3) User makes some changes.
4) User clicks 'X' button to close the toolbar.
5) User click the editable area again.
6) Toolbar re-appears.

I really appreciate any help you can give me.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 11 Jun 2009, 09:25 AM
Hello Andy,

You can get a reference to the RadWindow's ShowOnFocus toolbar of RadEditor and enable its titlebar and close button using the code below:

<script type="text/javascript"
function OnClientLoad(editor, args) 
     //Get a reference to the toolbar's RadWindow 
    var wnd = editor.get_toolAdapter().get_window(); 
    wnd.add_show(function() 
    { 
        wnd.set_visibleTitlebar(true); 
        wnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close) 
         
    }); 
</script> 
 
<telerik:radeditor runat="server" OnClientLoad="OnClientLoad" ToolbarMode="showOnFocus" ID="RadEditor1"></telerik:radeditor> 


All the best,
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
Andy
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or