忙指示不工作 - openui5

时间:2016-02-08 09:11:06

标签: sapui5

以下是view.js中的代码:

chart1 = new sap.ui.core.HTML({
            content:  "<div id=\"sdtochart1\" style=\"width: 100%; \"></div>",
            layoutData: new sap.ui.layout.GridData({span: "XL12 L12 M12 S12"}),
                                        })  

以下代码放在controller.js的onAfterRendering中

var bBusy = !chart1.isBusy();
        chart1.setBusy(bBusy);

上面的意图是显示忙碌指示符,直到html的内容被完全加载。但我没有看到任何繁忙的指标。

2 个答案:

答案 0 :(得分:1)

最外层html元素的id必须与HTML控件的id相同。否则setBusy()函数将找不到要将忙叠加div添加到的元素。

chart1 = new sap.ui.core.HTML({
        id: "sdtochart1",
        content:  "<div id=\"sdtochart1\" style=\"width: 100%; \"></div>",
        layoutData: new sap.ui.layout.GridData({span: "XL12 L12 M12 S12"}),
                                    })  

答案 1 :(得分:0)

Have you first tried to set the HTML control as Busy ? Also the method to get the busy status is getBusy()

From the documentation:

getBusy(): boolean
Gets current value of property busy.
Whether the control is currently in busy state.

Default value is false.

Returns:
{boolean}   Value of property busy