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

Custom Image Manager Dialog Broken

1 Answer 32 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Chris Queen
Top achievements
Rank 1
Chris Queen asked on 31 Mar 2014, 09:25 PM
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?

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 03 Apr 2014, 08:11 AM
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

Regards,
Ianko
Telerik
 

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.

 
Tags
Editor
Asked by
Chris Queen
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or