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

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:

主站蜘蛛池模板: 马公市| 仁布县| 铜鼓县| 高密市| 大安市| 洛川县| 德清县| 平利县| 富裕县| 全南县| 乌恰县| 满洲里市| 富蕴县| 枣强县| 灯塔市| 河曲县| 六安市| 南靖县| 饶平县| 河东区| 宣化县| 成安县| 扬中市| 乐清市| 安庆市| 博野县| 安徽省| 白城市| 于田县| 盐源县| 万州区| 滨海县| 图木舒克市| 化隆| 灌阳县| 廊坊市| 康定县| 正蓝旗| 云安县| 读书| 新野县|