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

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:

主站蜘蛛池模板: 河池市| 家居| 张北县| 衡山县| 乌鲁木齐县| 石嘴山市| 南通市| 金华市| 大竹县| 体育| 安溪县| 澳门| 卢氏县| 聂荣县| 南澳县| 交城县| 大同县| 双峰县| 犍为县| 滨海县| 洛川县| 五华县| 邢台县| 龙江县| 宝鸡市| 秭归县| 鸡西市| 保靖县| 中卫市| 延长县| 辽阳市| 承德县| 天水市| 托克托县| 中牟县| 浦东新区| 新密市| 延津县| 克东县| 怀来县| 平顶山市|