通过Dialog API显示对话框会禁用单元格编辑

在我的Excel加载项中,我使用Dialog API向用户显示消息。 对话框显示并closures,没有任何问题或错误抛出。

当closures对话框时,用户不能通过在单元格中单击并写入来编辑表格中的单元格。

如果用户双击某个单元格,则此function又回来了(对于所​​有单元格)。

这里是控制对话框的代码:

var app = (function (app) { var dialog; // Show dialog app.showNotification = function (header, text) { if (Office.context.requirements.isSetSupported('DialogApi', 1.1)) { var dialogUrl = window.location.href.substring(0, window.location.href.lastIndexOf('/') + 1) + "AppMessage.html?msg=" + text + "&title=" + header; Office.context.ui.displayDialogAsync(dialogUrl, { height: 20, width: 20, displayInIframe: true }, function (asyncResult) { dialog = asyncResult.value; dialog.addEventHandler(Office.EventType.DialogMessageReceived, processMessage); }); } }; function processMessage(arg) { if (arg.message == "close") dialog.close(); } return app; })(app || {}); 

和对话框代码

 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <script src="https://appsforoffice.microsoft.com/lib/1/hosted/Office.js" type="text/javascript"></script> <link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.min.css"> <link rel="stylesheet" href="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/css/fabric.components.min.css"> <script src="https://static2.sharepointonline.com/files/fabric/office-ui-fabric-js/1.4.0/js/fabric.min.js"></script> </head> <body> <span class="ms-font-xl ms-fontWeight-semibold" id="titleMain"></span> <p class="ms-font-m" id="body"></p> <button class="ms-Button ms-Button--primary" style="position:fixed;bottom:10px;right:10px;" onclick="closeDialog();"> <span class="ms-Button-label">OK</span> </button> <script src="appMessage.js"></script> </body> </html> 

这里是appMessage.js内容

 var urlParams; Office.initialize = function () {}; //avoiding the usage of jquery in this small page window.$ = function (selector) { return document.querySelector(selector); }; function closeDialog() { Office.context.ui.messageParent("close"); } (window.onpopstate = function () { var match, pl = /\+/g, // Regex for replacing addition symbol with a space search = /([^&=]+)=?([^&]*)/g, decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); }, query = window.location.search.substring(1); urlParams = {}; while (match = search.exec(query)) urlParams[decode(match[1])] = decode(match[2]); $("#titleMain").innerHTML = urlParams["title"]; $("#body").innerHTML = urlParams["msg"]; })(); 

什么可能是错的?

谢谢