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

Show files in separate window rather than IFrame

1 Answer 57 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Ryan Dailey
Top achievements
Rank 1
Ryan Dailey asked on 14 Jun 2010, 04:53 PM
Is there a way to make files inside the FileExplorer show up in a separate browser window, rather than inside the Iframe window?

1 Answer, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 15 Jun 2010, 02:44 PM
Hi Ryan,

It is possible to modify the default behavior of the OpenFile functionality by assigning a handler to the OnClientFileOpen client-side event and cancel the default execution using set_cancel(true) method.

You can achieve the required functionality using the following code:
<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" EnableOpenFile="true" OnClientFileOpen="OnClientFileOpen">
    <Configuration ViewPaths="~/" DeletePaths="~/" UploadPaths="~/" />
</telerik:RadFileExplorer>
 
<script type="text/javascript">
    function OnClientFileOpen(sender, args)
    {
        //check the type of the selected item
        if (!args.get_item().isDirectory())
        {
            var href = window.location.host;
            args.set_cancel(true);
 
            //open the item in new window to avoid losing current content
            window.open("http://" + href + args.get_item().get_url());
        }
    }
</script>

I hope this helps.

Regards,
Dobromir
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
FileExplorer
Asked by
Ryan Dailey
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Share this question
or