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

[Solved] RadEditor LinkManager editor.fire arguments

1 Answer 154 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Patrick McDavid
Top achievements
Rank 1
Patrick McDavid asked on 15 Mar 2010, 09:50 PM
So, I'm trying to fire a link manager with a predefined URL, but I can't find any documentation on the .fire options

    Telerik.Web.UI.Editor.CommandList["HaxLink"] = function (commandName, editor, args) { 
        //alert("HAXULATE"); 
        editor.fire("LinkManager", { href: "WTFYO" }); 
    }; 

sadly, the window pops, but nothing seems to send along the url, I've tried param names url, URL, href and HREF.

Any thoughts, anyone on LinkManager event arguments?

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 16 Mar 2010, 03:00 PM
Hi Patrick,

By design, LinkManager command does not accept any predefined arguments. In order to provide predefined URL for LinkManager dialog I would suggest you to modify the built-in dialog (or create a custom dialog based on the built-in one). Information regarding creating custom dialog and modifying built-in dialogs is available in the following articles:
Add Custom Dialogs
ExternalDialogsPath property
Customize Built-in Dialogs
Custom Dialogs

As an alternate workaround I can offer you the following code, but please note that it is considered as a hack and might not work for future releases:
Telerik.Web.UI.Editor.CommandList["Custom1"] = function(commandName, editor, args)
{
    var link = document.createElement("A");
    link.href = "http://www.something.com";
 
    var argument = new Telerik.Web.UI.EditorCommandEventArgs("LinkManager", null, link);
    argument.documentAnchors = Telerik.Web.UI.Editor.CommandList._getDocumentAnchors(editor.get_document());
    argument.showText = true;
    Telerik.Web.UI.Editor.CommandList._getDialogArguments(argument, "A", editor, "LinkManager");
 
    var callbackFunction = function(sender, args)
    {
        var realLink = args.get_value();
        if (!realLink) realLink = args.Result;
        if (!realLink) realLink = args.realLink;
 
        editor.pasteHyperLink(realLink, commandName);
    };
 
    editor.showDialog("LinkManager", argument, callbackFunction);
};            


Kind regards,
Dobromir
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
Patrick McDavid
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or