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

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

7 Answers 130 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Sundar
Top achievements
Rank 1
Sundar asked on 10 Feb 2009, 07:19 AM

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 .  

7 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 12 Feb 2009, 04:42 PM
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.
0
Subimal
Top achievements
Rank 1
answered on 02 Aug 2013, 03:59 AM
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
0
Ianko
Telerik team
answered on 06 Aug 2013, 10:28 AM
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.
0
Subimal
Top achievements
Rank 1
answered on 07 Aug 2013, 12:48 AM
Hi Lanko!

This is still not working :( Did you test the solution?
0
Ianko
Telerik team
answered on 09 Aug 2013, 10:56 AM
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.
0
Sailaja
Top achievements
Rank 1
answered on 19 Nov 2013, 03:52 PM
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.
0
Ianko
Telerik team
answered on 20 Nov 2013, 02:02 PM
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.
Tags
Editor
Asked by
Sundar
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Subimal
Top achievements
Rank 1
Ianko
Telerik team
Sailaja
Top achievements
Rank 1
Share this question
or