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

Collapsing dropdown after clicking into RadEditor

1 Answer 81 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 19 Mar 2010, 03:43 AM
Hi

I have a RadToolbar and a RadEditor on the same page. The toolbar has a dropdown in it. If I click on the dropdown button and the dropdown displays, and then click directly into the RadEditor, the dropdown remains open instead of automatically collapsing. Is there any way to force it to collapse?

1 Answer, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 23 Mar 2010, 03:08 PM
Hi Peter,

You should subscribe to OnClientLoad event of the editor and in its handler:

<script type="text/javascript">
       function OnClientLoad(editor, args) {
           var element = document.all ? editor.get_document().body : editor.get_document();
           $telerik.addExternalHandler(element, "click", function() {
               var toolBar = $find("<%=toolBar1.ClientID %>");
               for (var i = 0; i < toolBar.get_items().get_count(); i++) {
                   var item = toolBar.get_items().getItem(i);
                   if (item._isDropDownVisible == true)
                       item.hideDropDown();
               }
           });
       }
</script>

I've attached a simple page demonstrating this approach.

Sincerely yours,
Yana
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ToolBar
Asked by
Peter
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or