Anyone available?
Hi Farai,
Greetings from Syncfusion support.
We understand that you want to hide particular folders in the FileManager component. You can achieve this requirement by passing that folder name in our deleteFiles method inside the success event.
Please refer to the below code snippet.
[index.cshtml]
<ejs-filemanager id="filemanager" view="@Syncfusion.EJ2.FileManager.ViewType.Details" success="success" > <e-filemanager-ajaxsettings url=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/FileOperations downloadUrl=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Download uploadUrl=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Upload getImageUrl=https://ej2-aspcore-service.azurewebsites.net/api/FileManager/GetImage> </e-filemanager-ajaxsettings> </ejs-filemanager>
<script>
function success(args){
setTimeout(function () { var filemanagerElement = document.getElementById("filemanager"); var fileObj = filemanagerElement.ej2_instances[0]; fileObj.deleteFiles("Videos"); },1000); } </script> |
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/CoreFileManager-427232135.zip
For your reference, we have attached the sample. Please check the shared sample and let us know if it meets your needs.
Regards,
Prasanth Madhaiyan.
I tried what you suggested. Unfortunately. It has deleted my folders. I'm looking to hide and not delete.
Farai, We don’t have support to hide folders in the File Manager component. However, you can hide the folder by setting hidden attribute for the required folder element. For your reference, we just hide the “Documents” folder. Check out the below code snippet.
function success(args){ setTimeout(function () { var filemanagerElement = document.getElementById("filemanager"); var elements = filemanagerElement.querySelectorAll(".e-layout-content .e-list-item"); for(var i=0; i< elements.length; i++){ if(elements[0].innerText == "Documents") elements[0].hidden = true; } },100); } |
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/CoreFileManager2102745060
In a similar way, you can send additional attribute for required folders in server response to hide them within the success event. Check out the shared sample and let us know if you need any further assistance.
Thank you. Just what I was looking for.