- 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.
推薦閱讀
- Mastering NetBeans
- Spring Cloud、Nginx高并發核心編程
- 精通Scrapy網絡爬蟲
- Python編程從0到1(視頻教學版)
- Instant PHP Web Scraping
- 汽車人機交互界面整合設計
- 自學Python:編程基礎、科學計算及數據分析(第2版)
- HTML5+CSS3+JavaScript 從入門到項目實踐(超值版)
- JavaScript悟道
- Learning Kotlin by building Android Applications
- 微信小程序開發邊做邊學(微課視頻版)
- 跟小樓老師學用Axure RP 9:玩轉產品原型設計
- Learning Predictive Analytics with R
- Scratch 3少兒交互式游戲編程一本通
- C#面向對象程序設計(微課版)