Articles in this section

How to open dialog container to preview image in React File Manager?

This article explains how to open dialog container with required aspect ratio to preview an image in React File Manager.

Step 1: Implement File Manager component using our getting started documentation.

Step 2: To achieve the dialog container being opened in the required aspect ratio for previewing images, you can utilize the help of the React File Manager popupOpen event. The popupOpen event triggers when the dialog popup is opened and allows you to adjust the height and width of the dialog container according to your requirements. This enables you to open the dialog container with the required aspect ratio to preview images. Additionally, we can also resize the dialog container to improve the better appearance of image preview. 

[app.component.html]

<ejs-filemanager id='overview' height="700px" (popupOpen)="onPopupOpen($event)" [ajaxSettings]='ajaxSettings' [view]='view'>

</ejs-filemanager>

[app.component.ts]

public onPopupOpen (args: PopupOpenCloseEventArgs) {

    args.element.style.height = '600px';

    args.element.style.width = '600px';

}

[app.component.css]

.e-image-wrap {

    height: 100% !important;

    width: 100% !important;

}

Refer to the working sample for additional details and implementation: Sample 

Conclusion

We hope you enjoyed learning how to open dialog container with required aspect ratio to preview image in React File Manager.

You can refer to our React File Manager feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our React File Manager example to understand how to create and visualize data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsBoldDesk Support, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied