- Learning Google Apps Script
- Ramalingam Ganapathy
- 121字
- 2021-07-16 12:40:03
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.
推薦閱讀
- ASP.NET Core 5.0開發入門與實戰
- Vue.js快跑:構建觸手可及的高性能Web應用
- DevOps Automation Cookbook
- Data Analysis with IBM SPSS Statistics
- Mastering OpenCV 4
- Spring Cloud、Nginx高并發核心編程
- 名師講壇:Java微服務架構實戰(SpringBoot+SpringCloud+Docker+RabbitMQ)
- R Deep Learning Cookbook
- Visual C#.NET Web應用程序設計
- INSTANT Silverlight 5 Animation
- UI設計基礎培訓教程(全彩版)
- Visual Basic程序設計基礎
- Learning WordPress REST API
- Professional JavaScript
- 零基礎學Java(第5版)