官术网_书友最值得收藏!

Creating a modal dialog

To create a modal dialog, which prevents the user from updating anything in the spreadsheet or document, update the code in the Code.gs file as shown here:

function onOpen(){
  DocumentApp.getUi()
  .createAddonMenu()
  .addItem("Show Dialog", "showDialog")
  .addToUi();
}

function showDialog() {
  var html = HtmlService
   .createHtmlOutputFromFile('Index');
  DocumentApp.getUi()   
   .showModalDialog(html, 'Greeting');
}

Go to Add-ons | Chapter 2 | Show Dialog and a modal dialog will pop up:

主站蜘蛛池模板: 宜黄县| 历史| 江津市| 邹城市| 安塞县| 乳源| 新民市| 武宁县| 南汇区| 榆树市| 梅河口市| 巨野县| 郸城县| 西畴县| 得荣县| 泸溪县| 明水县| 福清市| 象山县| 长治县| 科技| 明光市| 天等县| 桑植县| 平湖市| 祥云县| 太仓市| 临高县| 西青区| 册亨县| 隆回县| 新民市| 文化| 奉节县| 肃宁县| 淮滨县| 宁晋县| 铜鼓县| 和平区| 夏津县| 江川县|