ejFileExplorer: How to customize Details dialog

Hi,
There is a way to customise or use a template for the Details dialog instead of the default one :



Thank you 




1 Reply

PR Piramanayagam Ramakrishnan Syncfusion Team October 3, 2018 12:50 PM UTC

Hi Fabrice, 
 
You can customize (add or remove) the Get Details dialog content with your custom details by using FileExplorerOperations class in FileExplorer component. Please refer to below code example. 
 
[controller] 
public class FileExplorerCustomOperations : FileExplorerOperations 
        { 
            FileExplorerOperations operation = new FileExplorerOperations(); 
            CustomFileExplorerResponse customDetails = new CustomFileExplorerResponse(); 
            public override object GetDetails(string path, string[] names, IEnumerable<object> selectedItems = null) 
            { 
                FileExplorerResponse response = (FileExplorerResponse)operation.GetDetails(path, names); 
                FileDetails fDetails = response.details.ElementAt(0); 
                CustomFileDetails cfDetails = new CustomFileDetails(); 
                CustomFileDetails[] responseDetails = new CustomFileDetails[1]; 
                cfDetails.Name = fDetails.Name; 
                cfDetails.Location = fDetails.Location; 
                cfDetails.Size = fDetails.Size; 
                cfDetails.Created = fDetails.Created; 
                cfDetails.IsFile = (fDetails.Type == "File Folder" ? "false" : "true"); 
                responseDetails[0] = cfDetails; 
                customDetails.details = responseDetails; 
                return customDetails; 
            } 
        } 
 
For your reference, we have prepared a sample based on this in the link: http://www.syncfusion.com/downloads/support/forum/140169/ze/DialogCustomization-1758681537.zip 
 
In this sample, we have added the custom attribute (IsFile) and removed item type attribute. 
 
To know more about the customization, please refer to below help document. 
 
Please let us know if you need any further assistance. 
 
Regards, 
Piramanayagam R 


Loader.
Up arrow icon