Uncaught TypeError:Liferay.NotificationsList不是在liferay中部署extjs应用程序时在浏览器中得到的构造函数

问题描述 投票:0回答:1

当我在Liferay中部署应用程序时,我使用的是Extjs版本6和Liferay 6.2.5,我在浏览器中遇到了异常。

e

exception extjs liferay extjs6
1个回答
0
投票

[我认为Piyush现在必须已经解决了它,如果其他人也遇到相同的问题,则将其发布。)]

您需要导入liferay-notification js模块才能使用Liferay通知。例如:

<aui:script use="liferay-notification"> 
    new Liferay.Notification({
        closeable: true,
        delay: {
            hide: 3000,
            show: 0,
        },
        duration: 500,
        message: message,
        title: 'Your success Message',
        type: 'success'
        //danger, warning and info also exists
    }).render();
</aui:script>

另一种方法是:

<script type="text/javascript">
    AUI().use('liferay-notification', function(A) {
        new Liferay.Notification({
            closeable: true,
            delay: {
                hide: 10000,
                show: 0
            },
            duration: 500,
            message: message,
            render: true,
            title: 'your success message',
            type: 'success'
        }).render('body');
    });
</script>
© www.soinside.com 2019 - 2024. All rights reserved.