Hi Telerik Team,
We are trying to create stand-along document, image, flash and media managers without Editor. We use RadDialogOpener to open different dialogs. It works great except we try to get select item value. We using "ClientCallbackFunction", in that function, the "args.get_value()" return an object. Can we have a method to return a html string so we can easily to display?
script below:
function CallbackFunction( sender, args )
{
}
Thanks,
Lan
5 Answers, 1 is accepted

function CallbackFunction( sender, args )
{
var selectElement = args.get_value(); // it's an object, can we make it as html string ?
}
This can be done only by customizing the logic implemented in the dialogs. I.e., Customizing the Built-in Dialogs—http://demos.telerik.com/aspnet-ajax/editor/examples/externaldialogspath/defaultcs.aspx.
In this case, you should configure the DialogDefinition instance with an ExternalDialogsPath parameter. Here you are an example:
DialogDefinition imageManager =
new
DialogDefinition(
typeof
(ImageManagerDialog), imageManagerParameters);
imageManager.ClientCallbackFunction =
"ImageManagerFunction"
;
imageManager.Width = Unit.Pixel(694);
imageManager.Height = Unit.Pixel(440);
//If you need to customize the dialog then register the external dialogs path
imageManager.Parameters[
"ExternalDialogsPath"
] =
"~/EditorDialogs/"
;
DialogOpener1.DialogDefinitions.Add(
"ImageManager"
, imageManager);
Regards,
Ianko
Telerik

Hi Lanko,
Thanks for replying. The code below is the javascript function. We want to get the selected item html string. For example, when when open ImageManager dialog, args.get_value() will an image object, we try to find a way to return a string like "<img src = '...' style='...' title='...' />". Is there any method or function we can use ?
function CallbackFunction( sender, args )
{
var selectElement = args.get_value(); // it's an object, can we make it as html string ?
}
Regards,
Lan
If the object returned from the dialog has no property that returns the string representation of the img tag, then I am afraid there is no method for that either.
This is why I suggested you to examine the code of the dialogs and examine it. And if needed, to eventually customize it as per to your needs.
Regards,
Ianko
Telerik
