Hi Team,
Is it possible to add hyperlinks to files on file explorer and also want to download the file immediately by clicking the link. Right now, we need to click "Download" button or "Right click on file --> click "Download".
fileLoad(args) {
if (args.module == 'LargeIconsView') {
//Create a link type button
var createTag = document.createElement('button');
createTag.innerHTML = 'Download';
createTag.className = 'e-custom e-btn e-link';
//Append the button with File Name
args.element
.querySelectorAll('.e-text-content')[0]
.appendChild(createTag);
}
}
success(args) {
var el = document.querySelectorAll('.e-custom');
var filemanager: any = this.fileManagerInstance;
for (var i = 0; i < el.length; i++) {
el[i].addEventListener('click', function() {
//Download the selected file
filemanager.downloadFiles(filemanager.selectedItems[0]);
});
}
} |
thank you so much, the solution is working for large icon view. I am trying to implement same solution for details view but click is not working even though td tags are registered with event lister. is it possible to achieve same solution to details view as well?
fileLoad(args) {
if (args.module == 'DetailsView') {
//Create a link type button
var createTag = document.createElement('button');
createTag.innerHTML = 'Download';
createTag.className = 'e-custom e-btn e-link';
//Append the button with File Name
args.element.querySelector('.e-fe-grid-name').appendChild(createTag);
}
let proxy: any = this;
if (args.element.querySelector('.e-custom') != null) {
args.element
.querySelector('.e-custom')
.addEventListener('click', function() {
setTimeout(function() {
//Download the selected file
proxy.fileManagerInstance.downloadFiles(
proxy.fileManagerInstance.selectedItems[0]
);
}, 5);
});
}
} |
Highly appreciated. It works for both detailed vs large icon view now. Thanks again