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

[Solved] Roll your own File Browsers (client side)

1 Answer 113 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Alan Gerling
Top achievements
Rank 1
Alan Gerling asked on 17 Oct 2007, 11:56 PM
I have an existing web application that i'm injecting the RAD Editor into. I have custom file browse and link tools (popups) that i need to use. how do i get them to interact with the editor? I've added a custom button to the tool bar but not sure how to update a link or image in the content.

1 Answer, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 19 Oct 2007, 03:29 PM
Hello nyhtal,

It should be relatively easy to hook your existing popup with RadEditor Prometheus. I suppose that your popup is executing a callback function when it is closed, or raises a client-side event (which is the same actually). In this function you need to invoke RadEditor's pasteHtml() method, something like this excerpt from RadEditor's source code:
this.LinkManager = function(commandName, editor, oTool)
{
  var argument = Telerik.Web.UI.Editor.CommandList._getLinkArgument(editor);
  var callbackFunction = function(sender, args)
  {
     editor.pasteHtml(Telerik.Web.UI.Editor.Utils.getOuterHtml(args.realLink), commandName);
  };
  editor.showDialog("LinkManager", argument, callbackFunction);
  return false;
};


commandName is a string, which is used in the undo history to show the user friendly command name. Here is the link to the online help article for pasteHtml() (which appears to be missing the info for the second parameter...)
http://www.telerik.com/help/radcontrols/prometheus/?pasteHtml.html

You can find the editor's instance by following the instructions in the next article:
http://www.telerik.com/help/radcontrols/prometheus/?GetingReferenceToRadEditor.html

Please, let me know if you need further assistance.

Greetings,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
Alan Gerling
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or