Folder selection cleared

Hi Team,

1. How to prevent from checkbox being checked whenever you select a file or Folder
2. Previous folder/files selected got cleared whenever we click on other folder/file 

Attachment: Clear_Folders_303a32ed.zip

3 Replies

SP Sowmiya Padmanaban Syncfusion Team May 8, 2020 02:00 PM UTC

Hi Mahesh,  
 
Greetings from Syncfusion support. 
 
Query1 - Prevent the checkbox being checked. 
 
By default, when you allowMultiSelection as true, it shows the checkbox element in FileManager component. If you don’t want to display the checkbox element. You can remove the checkbox element by fileLoad event. By using the following solution, we can remove the checkbox element from FileManager component and performs multiSelection. 
 
Refer the below code snippet. 
@Html.EJS().FileManager("filemanager").AllowMultiSelection(true).FileLoad("fileload").AjaxSettings(new Syncfusion.EJ2.FileManager.FileManagerAjaxSettings 
{ 
}).Render() 
 
<script> 
    function fileload(args) { 
        if (args.module == "LargeIconsView" || args.module == "DetailsView") { 
            var checkbox_element = args.element.querySelector(".e-checkbox-wrapper"); 
            checkbox_element.remove(); 
        } 
   } 
</script> 
 
Refer the sample link below. 
 
 
If you want to prevent the file from selection. To achieve this we can use FileSelection method of File Manager. This method triggers before the file get checked or unchecked. If you don’t want to check the particular files/folder, you need to set the args.cancel as true in this method. 
 
Refer the below code snippet. 
@Html.EJS().FileManager("filemanager").AllowMultiSelection(true).FileSelection("fileSelect").AjaxSettings(new Syncfusion.EJ2.FileManager.FileManagerAjaxSettings 
{ 
}).Render() 
 
<script> 
    function fileSelect(args) { 
        if (args.fileDetails.name == "Downloads") { 
            args.cancel = true; 
        } 
    } 
</script> 
 
 
Query 2 – Select Multiple Files. 
 
In FileManager component, we have provided support for multi selection. By enabling this AllowMultiSelection property, you can select more than one files/folder. Refer the below code snippet. 
 
@Html.EJS().FileManager("filemanager").AllowMultiSelection(true).FileSelection("fileSelect").AjaxSettings(new Syncfusion.EJ2.FileManager.FileManagerAjaxSettings 
{ 
}).Render() 
 
 
Refer the below link to know more about the File Manager component. 
 
 
 
 
If we misunderstand your requirement. Can you please share the below details. It will help us to resolve your issue at earliest. 
 
·        Video footage of Issue reproducing. 
 
·        Which file provider you have been used in your application? 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 



MM Mahesh Machina May 12, 2020 08:51 AM UTC

Thank you Sowmiya.

Our requirement is  not to remove checkbox, we are trying to stop from being checked whenever you click on file/folder not on check box

You can replicate the same in the sample you provided

 Steps to reproduce
1. Open documents folder
2. select first 3 files by checking checkbox on those file
3. clcik on 4th file not on check box ---> previous 3 files removed from selection(unselect event is firing here). how to stop this


SP Sowmiya Padmanaban Syncfusion Team May 13, 2020 01:10 PM UTC

Hi Mahesh,

We have checked your query with FileManager component. We would like to let you know that when you are enabling the multiselection property as true, you can select the file using CTRL+click for files/folders. To resolve your issue, you can click fourth file using CTRL key, it maintains the previous selection as similar as windows behavior.

If we have misunderstood your requirement. Can you please share the below details. It will help for us to resolve us issue at earlier. 
1.      Are you expecting to remove the tick icon in checkbox and also maintain the selection of particular  file/folder. 
 
Please let us know, if you need any further assistance on this. 
 
 
Regards,  
Sowmiya.P 


Loader.
Up arrow icon