Auto close modal dialog - After server code is done, close dialog in Google Spreadsheet

后端 未结 2 1634
误落风尘
误落风尘 2020-12-31 12:53

I have a Google Sheet that runs some Apps Script server code to connect to an SQL server. I want to show the message \"loading...\" in the modal dialog while data is being

2条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-31 13:26

    //show dialog

    var output = HtmlService.createHtmlOutput('Please wait...');
      SpreadsheetApp.getUi().showModalDialog(output, 'Saving...');
    

    some code

    //close dialog

      var output = HtmlService.createHtmlOutput('');
      SpreadsheetApp.getUi().showModalDialog(output, 'Loading...');
    

    *optional

      ui.alert("Saved Successfully!")
    

提交回复
热议问题