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

Passing Client Data via AddText Command

1 Answer 55 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 01 Aug 2012, 05:38 PM
Hello,
I have some custom commands that are working fine, and I am able to pass client data to the code-behind using the commandArgument. However, if I try to do the same thing for the built in AddText functionality, the popup dialog never displays.

//Javascript
//If this is done, the text editor dialog won't show. Not sure why.
Telerik.Web.UI.ImageEditor.CommandList.AddText = function (imageEditor, commandName, args) {
    var commandText = "AddText";
    var commandArgument = customClientSideDataHere;
    imageEditor.editImageOnServer(commandName, commandText, commandArgument, callbackFunction);
};

I am currently reading the custom data here:
protected void RadImageEditor1_ImageEditing(object sender, ImageEditorEditingEventArgs args)
{
 string text = args.Argument;
}

If I comment out the client-side code above, the Add Text popup works as expected. Is there something I am doing wrong, or is there another way to pass client side data to the code-behind?
Thanks,
Adrian

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 06 Aug 2012, 11:49 AM
Hi Adrian,

The issue with the non displaying AddText's dialog is due to that the code bellow is actually overwriting all the functions of AddText command. This approach is useful when you need to declare a custom command and its functionality. If you want to customize some of the RadImageEditor's built-in commands (as it is in the case when you want to extend AddText's functions), the best way is to modify the RadImageEditor's dialog for this command.

You could find more information about the mentioned approach in this help article: Loading the Dialogs from External Files and in this code library: Registering External Dialogs of RadImageEditor.

All the best,
Veselina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
ImageEditor
Asked by
Adrian
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or