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

AddressBox

3 Answers 20 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 10 Oct 2014, 08:04 AM
How can I transfer the url of the document I click on the AddressBox?
So when I click on a documented as shown in the AddressBox complete URL as www.mydomain.se/documents/mydocument.pdf

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 15 Oct 2014, 06:50 AM
Hi Kjell,

You can attach a handler to the FileExplorer's ClientItemSelected event where the path to the selected path can be taken in a similar way:

<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server" OnClientItemSelected="onClientItemSelected">
    <Configuration ViewPaths="~/Images" DeletePaths="~/Images" UploadPaths="~/Images" />
</telerik:RadFileExplorer>
<script>
    function onClientItemSelected(fileExplorer, args) {
        var siteUrl = document.location.origin,
            itemPath,
            path
        if (!args.get_item().isDirectory()) {
            itemPath = args.get_path();
        }
 
        path = siteUrl + "/" + itemPath;
        //open the selected image into a new window
        //window.open(path);
    }
</script>


Regards,
Vessy
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Kjell
Top achievements
Rank 1
answered on 17 Oct 2014, 07:41 AM
No difference with your example.
Want it to look like the attached image when I select a file.
When I double click it opens ....
0
Vessy
Telerik team
answered on 21 Oct 2014, 01:20 PM
Hello Kjell,

Thank you for the additional information - it seems that I have misunderstood the scenario you want to achieve.

In order to display the site URL in the FileExplorer's AddressBox you will need to implement a custom content provider and pass the desired URL mask to a mapping file. A live implementation of a similar approach is provided here: Use RadFileExplorer with physical and shared folder's paths

Regards,
Vessy
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
FileExplorer
Asked by
Kjell
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Kjell
Top achievements
Rank 1
Share this question
or