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

Load External Dialogs

4 Answers 90 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Tony
Top achievements
Rank 2
Tony asked on 06 Feb 2012, 04:31 PM
I am trying to implement a RadImageEditor with custom dialogs. I would like to load the dialogs from external location like the example here:
http://www.telerik.com/help/aspnet-ajax/radimageeditor-externaldialogspath-property.html
However, I do not have the property 'ExternalDialogsPath' available in the control.

I also tried to implement the example outlined here:
http://www.telerik.com/community/code-library/aspnet-ajax/image-editor/registering-external-dialogs-of-radimageeditor.aspx
But I get a ' 'LoadDialog' is not a member of 'Telerik.Web.UI.Editor.DialogControls.ImageEditorDialog' ' error message.

I am using the latest release (2011.3.1305.40).

What am I doing wrong?

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 07 Feb 2012, 11:55 AM
Hello Timothy,

I have answered an email from you on the same subject and I am pasting here the essential part from it:

This functionality is available since Q1 2012 BETA or 2012.1.201

This means that the easiest way to get it is to upgrade to the beta or to wait for the official release, since the version you are using is not the latest.

As for the code library - you need to make sure you have copied the class from the App_Code folder as well and that the namespaces match. The LoadDialog method is there, in the ImageEditorDialog.cs file.

All the best,
Marin
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
Tony
Top achievements
Rank 2
answered on 08 Feb 2012, 05:09 PM
Hello,

I am continuing testing with external dialogs in the beta. Is it possible to set default width/height values in the crop dialog? I tried setting the textbox values but that didn't seem to work.

Also, is it possible to automatically do a resize when the save button is clicked?

Thanks for your help!
Tim
0
Tony
Top achievements
Rank 2
answered on 08 Feb 2012, 07:23 PM
Hello,
I found the answer on how to automatically resize when save is clicked.

I am still interested in setting default values for width/height int he crop dialog. Currently it defaults to 50x50.

Thanks,
Tim
0
Marin Bratanov
Telerik team
answered on 10 Feb 2012, 04:26 PM
Hello Tim,

You can use the following script to preset the dimensions of the crop box:
function modifyCommand(imageEditor, args)
{
    waitForCommand(imageEditor, "Crop", function (widget)
    {
        widget._constraintBtn.set_checked(false); //stop the aspect ration constraint
        widget.set_width(100);
        widget.set_height(100);
        widget._updateCropBoxFromControls();
    });
}
 
function waitForCommand(imageEditor, commandName, callback)
{
    var timer = setInterval(function ()
    {
        var widget = imageEditor.get_currentToolWidget();
        if (widget && widget.get_name() == commandName)
        {
            clearInterval(timer);
            callback(widget);
        }
    }, 100);
}

Where modifyCommand is attached to the OnClientCommandExecuted event of the RadImageManager, e.g.:
<telerik:RadImageEditor ID="RadImageEditor1" runat="server" ImageUrl="~/telerik.png" ExternalDialogsPath="~/ImageEditorDialogs"
    ToolBarMode="Docked" Width="800px" OnClientCommandExecuted="modifyCommand"
    Height="450px">
</telerik:RadImageEditor>


All the best,
Marin
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
ImageEditor
Asked by
Tony
Top achievements
Rank 2
Answers by
Marin Bratanov
Telerik team
Tony
Top achievements
Rank 2
Share this question
or