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

[Solved] Document Managers Insert Button

2 Answers 122 Views
Editor
This is a migrated thread and some comments may be shown as answers.
pmoney pmoney
Top achievements
Rank 1
pmoney pmoney asked on 20 Jan 2010, 03:43 PM
Hey guys how do I get a handle to call a function when the Document Managers Insert Button is clicked then passing the variable of the file selected?

2 Answers, 1 is accepted

Sort by
0
pmoney pmoney
Top achievements
Rank 1
answered on 21 Jan 2010, 03:51 PM
Hello?
0
Rumen
Telerik team
answered on 25 Jan 2010, 04:27 PM
Hi,

Here is a sample javascript code that demonstrates how to modify the link in the dialog callback function:

Telerik.Web.UI.Editor.CommandList.DocumentManager = function(commandName, editor, commandArgs)
{
var argument = Telerik.Web.UI.Editor.CommandList._getLinkArgument(editor);
Telerik.Web.UI.Editor.CommandList._getDialogArguments(argument, "A", editor, commandName);
var callbackFunction = Telerik.Web.UI.Editor.CommandList.getCallbackFunction(commandArgs, function(sender, args)
{
var realLink = args.get_value();
//modify link here
//for example:
realLink.title = "test title";
 
editor.pasteHyperLink(realLink, commandName);
});
editor.showDialog("DocumentManager", argument, callbackFunction);
return false;
};

This Javascript should be placed under the RadEditor declaration.

Sincerely yours,
Rumen
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Editor
Asked by
pmoney pmoney
Top achievements
Rank 1
Answers by
pmoney pmoney
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or