vendredi 11 septembre 2015

auto close modal dialog google sheets - google apps script

I have a google sheet that I am connecting to a sql server to allow some non-sql server folks a tool to view and make small edits to data in a table. I have the read and write set up for the server, but want to create a "loading..." modal while data is being refreshed to prevent any issues. I can get the modal to pop up but am trying to figure out how to auto-close the dialog as soon as the code is finished firing.

An example I have set up is:

function testpop () {
  var htmlOutput = HtmlService
    .createHtmlOutput('<p> This box will close when the data has finished loading.</p>')
    .setSandboxMode(HtmlService.SandboxMode.IFRAME)
    .setWidth(250)
    .setHeight(200);
  SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Loading...');
  sleep(1000);
//close the dialog
}

I know this can be called on a client side but need it to be handled in the gs so it fires when the code is done. Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire