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

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.

主站蜘蛛池模板: 湟源县| 同心县| 大埔区| 湘潭市| 九江县| 韶关市| 宁晋县| 福贡县| 阿克陶县| 商水县| 阜康市| 榕江县| 山丹县| 乳山市| 汨罗市| 郑州市| 宁安市| 光山县| 乌兰察布市| 大田县| 贵南县| 道真| 防城港市| 和平区| 来安县| 繁昌县| 酉阳| 白朗县| 大石桥市| 德令哈市| 仪征市| 敦化市| 巢湖市| 合阳县| 视频| 南昌市| 凤冈县| 仁寿县| 碌曲县| 从江县| 吉木乃县|