Custom Image Manager Dialog Broken

2 posts, 0 answers
  1. Chris Queen
    Chris Queen avatar
    2 posts
    Member since:
    Aug 2009

    Posted 31 Mar 2014 Link to this post

    We were using this code to set a value in the editor from a custom dialog:

    Telerik.Web.UI.Editor.CommandList["BackgroundImage"] = 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) {
                if (!args) {
                    //alert("No args!");
                    return false;
                var selectedItem = args.get_value();
                var path = args.value.getAttribute("src", 2);
                var style = editor.get_contentArea().style;
                style.backgroundImage = 'url(' + path + ')';
                document.getElementById('<%=hdnBackgroundImage.ClientID %>').value = path;
            editor.showDialog("backgroundImageManager", argument, callbackFunction);
            return false;

    We upgraded to the latest Rad tools and now get an error on "args.value.getAttribute is not a function".

    What can we change to get that path value from the dialog?
  2. Ianko
    Ianko avatar
    1510 posts

    Posted 03 Apr 2014 Link to this post

    Hello Chris,

    The described error is thrown due to the object that is sent by the dialog. This matter should be implemented in the backgroundImageManager dialog, but I am unable to find any information regarding its implementation.

    Please provide a simple demo which demonstrates the custom dialog, so that I could reproduce and investigate the issue on my end.

    On a side note, I can suggest using the showExternalDialog() method, which is intended for custom dialogs. More information about its usage is available in this online example


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top