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

How to get ID of RadEditor

3 Answers 150 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Navnit
Top achievements
Rank 1
Navnit asked on 01 Oct 2012, 08:54 AM
Hello,

I have an RadListBox and 3 RadEditor on my page. Now I want to Drag & Drop Items of RadListBox into RadEditor. How can I get the ID of the RadEditor on which I am Dragging and Dropping the RadListBox Item?

As per the example provide I am able to Drag Drop Items in only one Hardcoded RadEditor. Below is the JavaScript for the same

function OnClientNodeDropping(sender, args) {
        var editor = $find("<%=RadEditor1.ClientID%>");
        var event = args.get_domEvent();
        document.body.style.cursor = "default";
        var result = isMouseOverEditor(editor, event);
        if (result) {
            var itemValue = sender.get_selectedItem().get_value();
            editor.setFocus();
            itemValue = "[[" + itemValue + "]]"
            editor.pasteHtml(itemValue);
        }
        setOverlayVisible(false);
    }

Now here what I want is If I am dragging and dropping items in RadEditor1 it should be placed inside RadEditor1, If I am dragging and dropping items in RadEditor2 it should be placed inside RadEditor2.

Please let me know how can I achieve this functionality. 
Thanks in advance for your help..

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 01 Oct 2012, 09:58 AM
Hi,

You should pass all instances of RadEditor available on the page to the editor parameter of the isMouseOverEditor(editor, event); function and if the result is true to paste the node contents in this editor which coordinates coincide with these ones of the overlay element.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Navnit
Top achievements
Rank 1
answered on 05 Oct 2012, 06:53 AM
Hi Rumen,

Thanks for the solution. Sorry for the delayed reply as I was on Leave. I got what you are trying to say but how do I get all the instance of RadEditor on the page as due to my requirement I will be dynamically adding RadEditor depending upon the user inputs. 

Thanks.
0
Accepted
Rumen
Telerik team
answered on 09 Oct 2012, 02:50 PM
Hello,

You can try the solution provided in this KB article: How-to create a javascript array of all particular RadControls on the page.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Navnit
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Navnit
Top achievements
Rank 1
Share this question
or