未捕获的TypeError:Liferay.NotificationsList不是我在浏览器中使用生命周期中部署extjs应用程序时获得的构造函数

时间:2018-03-05 08:14:07

标签: exception extjs liferay extjs6

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

e

1 个答案:

答案 0 :(得分: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>