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

Showing toast when a button is clicked

Toast appears as a popup window in the lower-right corner of the active spreadsheet with a title and message. To create a toast dialog, edit or replace the greeting function as follows:

function greeting() {
  SpreadsheetApp.getActiveSpreadsheet()
   .toast("Hello World!", "Greeting");
}

Now if you click the button, then a toast dialog will appear as shown in the following screenshot, and it disappears within 5 seconds (the default):

You can include a third argument, that is, timeout seconds, in the toast method. This means how long the toast will be visible for. Put a negative number if you want it to show up forever. For example, toast("Hello World!", "Greeting", -1).

Tip

Toast only works in Sheets.

主站蜘蛛池模板: 崇信县| 宜兰县| 江油市| 青神县| 桃江县| 简阳市| 青河县| 梁河县| 宣汉县| 从江县| 钟祥市| 合肥市| 延边| 梁平县| 额尔古纳市| 漳浦县| 门源| 文昌市| 镇宁| 通化县| 乡城县| 航空| 宾阳县| 满城县| 资溪县| 南华县| 伊通| 平遥县| 赣州市| 马龙县| 申扎县| 台南市| 玉山县| 扶绥县| 凤阳县| 永州市| 荔波县| 射洪县| 香港 | 开化县| 德阳市|