Set default "target" property to "New Window" in Document Manager Dialog of RadEditor

8 posts, 0 answers
  1. Sundar
    Sundar avatar
    14 posts
    Member since:
    Jul 2008

    Posted 10 Feb 2009 Link to this post

    Can someone tell me how to set default "target" property to "New Window" in Document Manager Dialog of RadEditor ?  ( Currently default target is “None” ).  I don't want to do this way http://www.telerik.com/community/forums/aspnet/editor/document-link-deafult-target-blank.aspx .  

  2. Rumen
    Admin
    Rumen avatar
    14323 posts

    Posted 12 Feb 2009 Link to this post

    Hi BenoitM,

    Please, see the following article on the subject:
    ExternalDialogsPath property.

    Once you configure the editor to use its external dialog files, you should open the \EditorDialogs\DocumentManager.ascx file and set the selectedIndex of the _documentTargetCombo object to 2, e.g.

    this._documentTargetCombo.selectedIndex = 2;

    The original index is 0.

    Here is the modified function:

    setItem : function(item) 
        { 
            this._currentItem = item; 
            this._documentTooltip.value = ""
            this._documentTargetCombo.selectedIndex = 2
            
            if (item.type == Telerik.Web.UI.Widgets.FileItemType.Directory) 
            { 
                this.get_element().style.display = "none"
            } 
            else 
            { 
                this.get_element().style.display = ""
            } 
        }, 


    Save the file and refresh the page.

    Greetings,
    Rumen
    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.
  3. Subimal
    Subimal avatar
    2 posts
    Member since:
    Aug 2013

    Posted 01 Aug 2013 Link to this post

    Hi -

    I need to achieve the same solution, but seems like I can't achieve as I am using the latest version. Can someone please guide me?

    Thanks
  4. Ianko
    Admin
    Ianko avatar
    1932 posts

    Posted 06 Aug 2013 Link to this post

    Hi,

    The DocumentManager.ascx user control is different in the latest version, but you could still use the same approach suggested by Rumen. What you should do is to change directly the link, rather than the index of the selection drop-down.

    Here you are an example of the same method modified for the latest version of RadControls (2013.2.717):
    setItem: function (item) {
                this._currentItem = item;
     
                if (item.get_type() == Telerik.Web.UI.FileExplorerItemType.Directory) {
                    this.get_element().style.display = "none";
                }
                else {
                    this.get_element().style.display = "";
                    var linkManagerParameters = this.get_browser().get_clientParameters();
                    linkManagerParameters.realLink.target = "_blank"; //Set from here the default parameter
                    if (!linkManagerParameters) {
                        //call function with a small timeout, waiting for clientInit.
                        //this can happen after upload when the FileExplorer selects an item before the browser is initialized;
                        window.setTimeout(Function.createDelegate(this, function () {
                            var linkManagerParameters = this.get_browser().get_clientParameters();
                            this._setLinkManagerItem(item, linkManagerParameters);
                        }), 150);
                    }
                    else {
                        this._setLinkManagerItem(item, linkManagerParameters);
                    }
                }
            },

    Regards,
    Ianko
    Telerik
    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 the blog feed now.
  5. Subimal
    Subimal avatar
    2 posts
    Member since:
    Aug 2013

    Posted 06 Aug 2013 Link to this post

    Hi Lanko!

    This is still not working :( Did you test the solution?
  6. Ianko
    Admin
    Ianko avatar
    1932 posts

    Posted 09 Aug 2013 Link to this post

    Hi,

    I am attaching a short clip presenting the default value of the target attribute in the document manager after the modification in the dialog.

    Also there is attached the sample project I have been working with, so that you could follow it and use it for your project.

    If you still have difficulties about the custom dialog please get back to me with information about some of the following issues:
    • Confirm that you are using the latest version of RadControls (2013.2.717);
    • Confirm that you are copying the desired Dialog file from the installation folder of RadControls;
    • Could you try following the approach from this online demo and let me know if you encounter the same problem;

    This additional information will help me investigate the described issue.


    Regards,

    Ianko
    Telerik
    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 the blog feed now.
  7. Sailaja
    Sailaja avatar
    11 posts
    Member since:
    Nov 2013

    Posted 19 Nov 2013 Link to this post

    Hi,
    I am facing an issue in radeditor hyperlink manager. by default 'target' value is getting saved as  'new window', when i am choosing any other options and after clicking ok it is modified as 'new window'. when I reopen the hyperlink manager I am only getting 'new window' but not the previous option what i have chosen.
    can any one help me in finding the solution. currently we are using telerik version 2012.2.912.35.
  8. Ianko
    Admin
    Ianko avatar
    1932 posts

    Posted 20 Nov 2013 Link to this post

    Hello Sailaja,

    I tried to reproduce the problem, but to no avail. Please try using this online demo and get back to me with the exact steps, so that I could investigate them. It would be helpful if you could create a screencast of the process so that I could be sure what is the described unexpected behavior. 

    Note that only the last target attribute's value should be correctly saved into the HTML content. You could check if it is correct by switching to HTML view.

    Regards,
    Ianko
    Telerik
    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 the blog feed now.
Back to Top