30 Answers, 1 is accepted
You can easily show the ImageManager or any other *Manager dialog without RadEditor, using the code below:
<div>
<script type="text/javascript">
function ImageManagerFunction(sender, args)
{
var selectedItem = args.SelectedItem;
var resultImageObject = args.Result;
alert("You selected " + selectedItem.GetPath());
var txt = $get('<%= TextBox1.ClientID %>');
txt.value = resultImageObject.outerHTML;
}
</script>
<asp:scriptmanager id="ScriptManager1" runat="server" />
<asp:textbox runat="server" id="TextBox1"></asp:textbox>
<telerik:dialogopener runat="server" id="DialogOpener1">
</telerik:dialogopener>
<button onclick="$find('<%= DialogOpener1.ClientID %>').open('ImageManager');">
Open ImageManager
</button>
</div>
using Telerik.Web.UI;
using Telerik.Web.UI.Editor.DialogControls;
public partial class ImageManager_Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
FileManagerDialogParameters dialogParameters = new FileManagerDialogParameters();
dialogParameters.ViewPaths = new string[] { "~/" };
dialogParameters.UploadPaths = new string[] { "~/" };
dialogParameters.DeletePaths = new string[] { "~/" };
dialogParameters.MaxUploadFileSize = 5000000;
// If you don't set the following property, the default value will be used
// dialogParameters.SearchPatterns = new string[] { "*.jpg" };
DialogDefinition imageManager = new DialogDefinition(typeof(ImageManagerDialog), dialogParameters);
imageManager.ClientCallbackFunction = "ImageManagerFunction";
imageManager.Width = Unit.Pixel(694);
imageManager.Height = Unit.Pixel(440);
DialogOpener1.DialogDefinitions.Add("ImageManager", imageManager);
}
}
Please, note that this is still undocumented functionality and could be a subject for changes, because we are still optimizing the API of the RadEditor dialogs.
Sincerely yours,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Greetings,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
alert("You selected " + selectedItem.GetPath());
It appears that the GetPath method of the selectedItem object does not exist. When I comment out this line, the code works - although I'd like to only have the name of the file returned rather than the image tag. I've looked all over for documentation on these client side objects and I can't find any reference to them. Can you tell me how I can get info on this object so I can get this to work properly. Also, any updates on a new component for just the Dialogs? To me this would be a very useful component! Thanks for your help.
Darren
The Telerik.Web.UI controls follow the MS AJAX code convention and their methods now start with small letters. You need to replace the selectedItem.GetPath() with selectedItem.getPath() and this will fix the JavaScript problem.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
The observed behavior is due to that the RadMenu control has a bigger z-index than RadWindow (used by RadEditor's dialogs). To fix the problem, decrease the z-index value of RadMenu by setting the style property for example to 10000, e.g.
<telerik:RadMenu style="z-index:10000" ID="RadMenu1" runat="server" Skin="Telerik">
In the official release of RadControls "Prometheus", scheduled for today, all controls will support the style="z-index: xxxx" property.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
For your convenience, I have attached a sample working project that demonstrates how to use the Document manager of RadEditor for ASP.NET AJAX as a standalone control.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
Thank you,
Marc Gendron
My suggestion is to convert the C# code to VB.NET using our code convertor: http://converter.telerik.com. Please, let me know if you experience any problems and I will be glad to help.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
when i use the ImageManagerDialog, the incredibly great "Image Editor" button is there, but when i click on it, i get an error:
"'this.get_editor()' is null or not an obect"
it is trying to find an ImageEditorDialog or a RadEditor?
i've managed to add the ImageEditorDialog to a page and can open it manually. but i'm having trouble getting the two to link up.
I think that this is a bug in our code. The Image Editor should be available outside the editor as well. I will log this in the bug tracker and I hope that we will manage to fix it in time for the service pack release in mid-May.
Best wishes,
Lini
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
"Web.config registration missing!
The Telerik dialogs require a HttpHandler..."
Marc
Here is an example how to correct the code to work in IE and Firefox:
<script type="text/javascript">
function DocumentManagerFunction(sender, args)
{
var selectedItem = args.SelectedItem;
var resultDocumentObject = args.Result;
alert("You selected " + selectedItem.getPath());
var txt = $get('<%= TextBox1.ClientID %>');
txt.value = resultDocumentObject.pathname;
}
</script>
<asp:textbox runat="server" id="TextBox1"></asp:textbox>
<telerik:dialogopener runat="server" id="DialogOpener1">
</telerik:dialogopener>
<button onclick="$find('<%= DialogOpener1.ClientID %>').open('DocumentManager');return false;">
Open Document Manager
</button>
You need to set return false after the open method in the onclick event of the button tag as well as replace resultDocumentObject.outerHTML with resultDocumentObject.pathname.
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I have a quick questions regarding to this feature, I mange to open up the image manager, store image and retrieve the path using the javascript.
However i'm having problem trying to retrieve the alt text. Is there a javascript command for this? just like getPath() method?
thank you
You can get the alt attribute information from the resultImageObject object with the following code:
resultImageObject.alt
or
args.Result.alt
Best regards,
Rumen
the Telerik team
Instantly find answers to your questions at the new Telerik Support Center
I would like to use the "LinkManager" dialog as a standalond, just like this thread regarding the ImageManager.
I followed the instructions here and it will display the link manager but I get a javascript error, saying realLink is null. realLink is a child of _clientParameters.
I presume there is a probably with initializing some element of the dialog. Is there some way to work around this?
Thanks.
Due to the multiple customers' requests we provided the ability to use the Image and Document managers as standalone controls. However the rest of the editor's dialogs are tidily integrated with RadEditor and they cannot be used without RadEditor.
Currently, it is not possible to use the rest of the dialogs separately, but if more people request this feature we will consider implementing it.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
http://www.telerik.com/community/code-library/submission/b311D-bkkaek.aspx
Thank you for the code library project!
I just want to add that there is a KB article on the subject: Using the Image and Document managers outside RadEditor, which provides additional guidance how to configure and use the Image Editor dialog from the standalone Image Manager.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Your project is great and to complete it you should add only the code for using the Image Editor. I will notify you if we provide support for using new dialogs as standalone so that you can update the project.
Best regards,
Rumen
the Telerik team
Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Has there been any progress since the last post regarding using other dialogs outside of the radeditor (namely the link manager mentioned above)?
If not please take this a request to add to your list of others wanting this facility
Cheers Marcus
Please examine the following online demo:
http://demos.telerik.com/aspnet-ajax/editor/examples/externaldialogspath/defaultcs.aspx
Best wishes,
Tervel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
I was more referring to using the link manager stand alone in the same way as the following
http://www.telerik.com/support/kb/aspnet-ajax/editor/using-the-image-and-document-managers-outside-radeditor.aspx
rather than still have to use the radeditor at all. The link you provided only has customizing the dialogs but they are still used within the radeditor.
regards marcus
I see your point. Yes, we still have plans to expose the ability to call editor dialogs, and we even wanted to do it for Q1 2009. We did manage to streamline the client-side mechanism for exchanging arguments from dialog to the main page. We also did some work on the RadDialogOpener and exposed it as a public class. However, this effort was not fully completed because the RadFileExplorer control - which is related to the DialogOpener, yet released as an independent control - was with a higher priority.
What needs to be done is to provide declarative support to the RadDialogOpener's DialogDefinitions. I strongly hope that we will manage to squeeze that in for the Q2 2009 as most of the things have alerady been done. However, please note that the priority of this functionality is not as high as with other requested features.
All the best,
Tervel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Thank you for the posted code. I just wish to add a small correction for people reading your post:
$get and $find methods are not related to jQuery. These are standard methods in ASP.NET AJAX framework and have been provided/implemented by Microsoft (and they do work correctly).
Greetings,
Tervel
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.