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

Unable to hide rad menu when used on the editor

1 Answer 49 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Eric
Top achievements
Rank 1
Eric asked on 01 Nov 2010, 03:46 PM
Because the context menu on the rad editor does not support nested menus, I have added a custom item to the context menu.  When the user mouses over the custom menu item it shows and positions the new rad menu accordingly.  It seems to be working very nicely except when the user shows the new rad menu but does not select anything it does not hide.  I tried 
contextMenu.add_hide(function (sender, args) {
            var menu = $find("<%=NestedContextMenu.ClientID %>");
            menu.hide();
            alert('hiding');
        });

and it works fine.  But if I have the above code and the following code:
var editor = $find("<%=TemplateEditor.ClientID%>");
 
menu.add_itemClicked(function (sender, args) {
    var menuItemValue = args.get_item()._getData().text;
    var editor = $find("<%=TemplateEditor.ClientID%>");
    editor.setFocus();
    editor.pasteHtml('hello');
    });

the item click event never fires.  I have tried everything.  Does anyone have any suggestions?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Nov 2010, 12:43 PM
Hello Eric,

Since you have not provided a fully runnable project which demonstrates the issue, can you please modify the following project customradcontextmenu-kb.zip to a point where it shows the reported behavior. Once you are ready you can send the zipped project by opening a new support ticket.

You should also note that the setFocus method will destroy the selection in RadEditor and the content will be pasted via the pasteHtml method in the beginning of the content area.

Best wishes,
Rumen
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
Editor
Asked by
Eric
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or