- 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 phpMyAdmin 3.4 for Effective MySQL Management
- Python金融數據分析
- 前端HTML+CSS修煉之道(視頻同步+直播)
- Android開發案例教程與項目實戰(在線實驗+在線自測)
- BIM概論及Revit精講
- 基于Struts、Hibernate、Spring架構的Web應用開發
- Building Serverless Web Applications
- Monitoring Docker
- Sitecore Cookbook for Developers
- Java程序設計教程
- Getting Started with Windows Server Security
- Java EE 程序設計
- Python實戰指南:手把手教你掌握300個精彩案例
- GO語言編程從入門到實踐
- jBPM6 Developer Guide