您好我有一個簡單的頁面上傳到SharePoint頁面庫,並試圖模擬長時間運行的操作,沒有關閉等待對話框。 下面是我的腳本是什麼Sharepoint2013 Modal對話框未加載
<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>
任何幫助,非常感謝。
感謝, Mallikarjun