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

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.

主站蜘蛛池模板: 西林县| 泗水县| 汾阳市| 辛集市| 昭通市| 松江区| 洛扎县| 海伦市| 新野县| 平安县| 正宁县| 贡山| 静乐县| 印江| 库尔勒市| 红原县| 喀喇| 皮山县| 庆城县| 祥云县| 兰坪| 泾阳县| 邛崃市| 廉江市| 湖北省| 名山县| 五莲县| 九龙城区| 宜宾县| 蒙山县| 新沂市| 拉萨市| 宝应县| 兴宁市| 乡宁县| 南丰县| 邻水| 滦南县| 黄山市| 阆中市| 桃园市|