gpt4 book ai didi

sharepoint-2013 - Sharepoint 2013 模态对话框未加载

转载 作者:行者123 更新时间:2023-12-02 03:30:19 25 4
gpt4 key购买 nike

您好,我有一个简单的页面上传到 SharePoint 页面库,并试图模拟长时间运行的操作,没有关闭等待对话框。下面是我所拥有的脚本

<script type="text/javascript">
var waitDialog = null;
function DoWork() {
toggleProcessingStatus(true);
UpdateUI();
toggleProcessingStatus(false);
}
function UpdateUI()
{
var lblControl = document.getElementById("lbl");
for (i = 0; i < 20000; i++)
{
lblControl.innerText = lblControl.innerText + i;
}
}
function toggleProcessingStatus(showStatus) {
if (showStatus) {
ExecuteOrDelayUntilScriptLoaded(ShowWaitDialog, "sp.js");
}
else {
if (waitDialog != null) {
//setTimeout(CloseWaitDialog, 5000);
CloseWaitDialog();
}
}
}
function ShowWaitDialog() {
waitDialog = SP.UI.ModalDialog.showWaitScreenWithNoClose('Updating...', 'Please wait while update completes...', 150, 330);
}

function CloseWaitDialog() {
if (waitDialog != null) {
waitDialog.close();
}
}
</script>
<input type="button" id="btnShowDialog" title="Do Long Running Work" name="Do Long Running Work" onclick="javascript: DoWork();" value="Do Long Running Work"/>
Label: <label id="lbl" title="Test">Test Wait Screen</label>

非常感谢任何帮助。

谢谢,马利卡君

最佳答案

必须加载“sp.ui.dialog.js”。

我已将以下代码添加到我想打开对话框的当前页面。

关于sharepoint-2013 - Sharepoint 2013 模态对话框未加载,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27274772/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com