Make file path as hyperlink

Currently my requirement is to provide direct link to a file. I am able make hyperlink till a particular folder level. I wish to provide a direct link to a file instead of taking me to folder. Is this achievable by any means? Below pic for providing a idea on hyperlink to folder where the file resides. Just a similar need to get for file.



1 Reply 1 reply marked as answer

IL Indhumathy Loganathan Syncfusion Team March 8, 2021 12:26 PM UTC

Hi Saswati, 
 
Greetings from Syncfusion support. 
 
We have validated your requirement in FileManager component. You can add a hyperlink in FileManager details dialog by using the beforePopupOpen event which will trigger before the dialog open. We have performed the below customization to modify the Location in dialog tab as a hyperlink. 
 
function beforepopupopen(args) { 
    if (args.popupName == "File Details") { 
        var table = document.getElementById("file_dialog_dialog-content").querySelector("table"); 
        for (var i = 0; i < table.rows.length; i++) { 
            // GET THE CELLS COLLECTION OF THE CURRENT ROW. 
            var Cells = table.rows.item(i).cells; 
            if (Cells[0].innerText == "Location") { 
                var createTag = document.createElement("a"); 
                var createText = document.createTextNode(Cells[1].innerText); 
                createTag.setAttribute("rel='nofollow' href", Cells[1].innerText); 
                Cells[1].innerText = ""; 
                createTag.appendChild(createText); 
                Cells[1].appendChild(createTag); 
            } 
        } 
    } 
} 
 
In the above code, we have created a anchor tag for the particular table cell and append it to the table. We have provided the FileManager path as hyperlink. 
 
Please find the sample demonstrating the solution. 
 
 
Please, check out the following links to know more about EJ2 File Manager component and its functionalities. 
 
 
 
 
If we have misunderstood, kindly share us some clear details on your exact requirement to assist you promptly.  
 
Please let us know if you need further assistance. 
 
Regards, 
Indhumathy L

Marked as answer
Loader.
Up arrow icon