AddressBox

4 posts, 0 answers
  1. Kjell
    Kjell avatar
    203 posts
    Member since:
    May 2011

    Posted 10 Oct 2014 Link to this post

    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
  2. Vessy
    Admin
    Vessy avatar
    1382 posts

    Posted 15 Oct 2014 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Kjell
    Kjell avatar
    203 posts
    Member since:
    May 2011

    Posted 17 Oct 2014 in reply to Vessy Link to this post

    No difference with your example.
    Want it to look like the attached image when I select a file.
    When I double click it opens ....
  5. Vessy
    Admin
    Vessy avatar
    1382 posts

    Posted 21 Oct 2014 Link to this post

    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.

     
Back to Top