Load External Dialogs

5 posts, 0 answers
  1. Tony
    Tony avatar
    12 posts
    Member since:
    Jan 2008

    Posted 06 Feb 2012 Link to this post

    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?
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 07 Feb 2012 Link to this post

    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 >>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tony
    Tony avatar
    12 posts
    Member since:
    Jan 2008

    Posted 08 Feb 2012 Link to this post

    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
  5. Tony
    Tony avatar
    12 posts
    Member since:
    Jan 2008

    Posted 08 Feb 2012 Link to this post

    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
  6. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 10 Feb 2012 Link to this post

    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 >>
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017