【问题标题】:Liferay - Show spinner while page is loadingLiferay - 在页面加载时显示微调器
【发布时间】:2014-03-17 22:54:08
【问题描述】:

我有一个 portlet(页面上只有一个 portlet)并且想在用户等待请求时显示一个微调器(或沙漏)。

liferay-portlet.xml 中将render-weight 设置为0 有效,但随后不会加载CSS 类并且不再解析url 参数。

还有其他解决方案吗?

[我正在运行 Liferay 6.1.20 EE]

提前致谢, 法比

【问题讨论】:

    标签: jsf liferay liferay-6


    【解决方案1】:

    通过使用 jQuery,我可以在用户点击链接时将 cursor 设置为 wait

    jqueryBusy = function(){
         $("a").click(function() {
                $("*").css("cursor", "wait");
         });
    };
    

    我在页面加载时调用此函数,并且在某个 ajax 请求繁忙时类似地调用此函数:

    if (!window["busystatus"]) {
        var busystatus = {};
    }
    
    busystatus.onStatusChange = function onStatusChange(data) {
        var status = data.status;
    
        jqueryBusy(); //set jquery event handler for all links
    
        if (status === "begin") { // turn on busy indicator
            document.body.style.cursor = 'wait';
        } else { // turn off busy indicator, on either "complete" or "success"
            document.body.style.cursor = 'auto';
        }
    };
    
    jsf.ajax.addOnEvent(busystatus.onStatusChange);
    

    为我工作。

    【讨论】:

      猜你喜欢
      • 2013-04-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-01-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多