We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Default sort by Modified date [asc/desc]?

Hi Everybody,

I'm using EJ2 FileManager for JavasScript, I have a question: Can I setting my FileManager with default sort by Modified date [asc/desc].
FileManager control's default sort by Name asc

Thanks

5 Replies

KR Keerthana Rajendran Syncfusion Team December 16, 2019 10:05 AM UTC

Hi Bui duc Anh, 
 
Good day to you, 
 
We have checked your reported query on “sort the files based on dateModified by default”. Currently, we have not provided support for this. But we can achieve your requirement in sample level with a workaround solution. In File manager component, success () event is triggered when ajax request is complete. By using this event you can change the sort of file manager after the data is loaded in the file manager. Refer the below code snippet. 

 success: function(args) { 
          var root = this.element; 
          setTimeout(function(){ 
            // You can get the datemodified header and perform the click operation. 
            root.querySelectorAll(".e-headercell")[3].click(); 
          }, 1000); 
        } 
 
                                                                  
  
  
  
  
  
  
  
For your reference, we have prepared a sample. 

Please let us know, if you have any concerns. 
 
Regards, 
Keerthana 



BD Bui duc Anh June 18, 2020 05:01 PM UTC

thank you so much Keerthana, I did it


SP Sowmiya Padmanaban Syncfusion Team June 19, 2020 04:33 AM UTC

Hi Bui duc Anh,  
  
Most Welcome. We are happy to hear that your probelm has been resolved. Please contact us, if you need any help from us. 
  
Regards, 
Sowmiya.P 



BD Bui duc Anh July 10, 2020 04:03 AM UTC

I read the NEW FEATURES release on version 18.2.44
#275878 - Provided an option to prevent default sorting of the files and folders in the File Manager component.

Could you please tell me is this the option to set default sort (by name, modified date..) asc/desc? and how to do that?

Thanks



SA Shameer Ali Baig Sulaiman Ali Baig Syncfusion Team July 13, 2020 06:01 AM UTC

Hi Bui duc Anh, 
 
Thanks for contacting Syncfusion support. 
 
In the latest EJ2 version (v18.2.44), we have introduced option to prevent default sorting (Ascending) in File Manager. 
 
By setting the sortOrder as None (Indicates that the folders and files are not sorted), we can prevent the default sorting in FileManager. 
 
Please, check the following sample for sortOrder as none 
 
 
This feature not provides option to set sortOrder by date modified, name and such fields. We suggest you use our previously shared solution to meet your expected requirement. 
 
Please, let us know if you need any further assistance. 
 
Regards, 
Shameer Ali Baig S.  


Loader.
Live Chat Icon For mobile
Up arrow icon