SapUI5 UploadCollection 在同一窗口中预览图像 [英] SapUI5 UploadCollection Preview Image in same window

查看:58
本文介绍了SapUI5 UploadCollection 在同一窗口中预览图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 SapUI5 UploadCollection 从用户上传图像UploadCollection 示例

I am using the SapUI5 UploadCollection to upload Images from users as recommended in UploadCollection Samples

问题是单击图像时会在单独的新窗口中打开.有没有办法在同一个窗口中显示图像的预览?

Problem is when clicking on the image it opens in a separate new window. Is there any way to show a preview of the image in the same window ?

推荐答案

SapUI5 Lightbox 控件允许用户以原始大小查看图像.控件会在弹出窗口中显示图像,同时使屏幕的其余部分变暗.

The SapUI5 Lightbox control allows users to view an image in its original size. The control displays the image in a popup while dimming the rest of the screen.

通过使用 UploadCollectionItem 的按下事件,您可以显示图像的灯箱预览,如下所示:

By using the press event for the UploadCollectionItem you can show a LightBox preview of the image as follows:

<UploadCollectionItem press="onUrlPress" thumbnailUrl="{ProductPhotos>UrlThumb}" url="{ProductPhotos>Url}" >


 onUrlPress: function (oEvent) {
        var item = oEvent.getSource();
        var url = item.getProperty("url");
        this.lightbox = new LightBox({
            imageContent: {
                title: url,
                imageSrc: url
            }
        });
        this.lightbox.open();
    },

这篇关于SapUI5 UploadCollection 在同一窗口中预览图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆