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

File explorer not rendering correct

Hi,

I am using a fileexplorer in a modal popup (bootstrap) and I can't seem to get it to render correct.
The navigation pane is always very narrow.

Below is the code used in the view.


 @(Html.EJ().FileExplorer("fileExplorer")
            .Path("~/resources/")
            .AjaxAction(@Url.Content("FileActionDefault"))
            .ToolsList(toolsList)
            .AjaxAction("/File/FileActionDefault")
            .Layout(LayoutType.LargeIcons)
            .Tools(tool =>
                tool.CustomTool(custom =>
                custom.Name("Gebruiken")
                .Tooltip("Gebruiken")
                .Css("e-fileExplorer-toolbar-icon Help")
                .Action("dialogOpen").Add()
                ))
            .AllowMultiSelection(false)
            .Layout(LayoutType.LargeIcons)
            .Width("100%")
        )

Any help would be greatly appreciated.

Best regards
Ivo

3 Replies

BP Balamurugan P Syncfusion Team December 19, 2016 12:41 PM UTC

Hi Ivo, 
Thanks for using Syncfusion products. 
We have analyzed the reported issue with our sample;  The reported issue (“FileExplorer has not rendered properly in a model popup”) occurs, while rendering FileExplorer control in the hidden state (display: none). Normally, you can’t get the height and width of an element in hidden state. To resolve this problem, you have to call the “adjustSize()” method of “FileExplorer” control after dialog has been opened. Please refer the below code block to resolve this problem. 
Code example [CSHTML]: 
@{Html.EJ().Dialog("modelDialog").Title("FileExplorer").IsResponsive(true).Containment(".control").ContentTemplate(@<div> 
            @(Html.EJ().FileExplorer("fileExplorer") 
            .Path("~/resources/") 
            .AjaxAction(@Url.Content("FileActionDefault")) 
            .ToolsList(toolsList) 
             .AjaxAction("/FileExplorer/FileActionDefault") 
            .Layout(LayoutType.LargeIcons) 
            .Tools(tool => 
                tool.CustomTool(custom => 
                custom.Name("Gebruiken") 
                .Tooltip("Gebruiken") 
                .Css("e-fileExplorer-toolbar-icon Help") 
                .Action("dialogOpen").Add() 
                )) 
            .AllowMultiSelection(false) 
            .Layout(LayoutType.LargeIcons) 
            .Width("100%") 
            ) 
        </div>).EnableModal(true).EnableResize(false).ShowOnInit(false).Width(900).ClientSideEvents(evt => evt.Open("adjustSize").Resize("adjustSize").Close("onDialogClose")).IsResponsive(true).Render();} 
 
<script type="text/javascript"> 
function adjustSize(args) { 
           $("#fileExplorer").ejFileExplorer("adjustSize");       
    } 
</script> 
 
We have prepared a sample based on your requirement and you can find the sample under the following location:  
 
Still if you have this problem, please get back to us with some additional information to reproduce this issue.  This would be helpful for us to serve you. 
Regards, 
Balamurugan 



IV ivo ver eecke December 19, 2016 05:46 PM UTC

Thanks, this works very well!!


BP Balamurugan P Syncfusion Team December 20, 2016 05:32 AM UTC

Hi Ivo,   
Most welcome. 

 
Regards, 
Balamurugan 


Loader.
Up arrow icon