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

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.

主站蜘蛛池模板: 讷河市| 冕宁县| 芒康县| 蒙城县| 阳山县| 呼图壁县| 丰台区| 始兴县| 丰台区| 青岛市| 城固县| 射阳县| 基隆市| 新河县| 太仆寺旗| 拉萨市| 沁源县| 寻乌县| 会昌县| 长岭县| 彩票| 托里县| 遂宁市| 广西| 柳江县| 开原市| 丰原市| 望城县| 伊宁县| 沂水县| 冀州市| 无为县| 丘北县| 巫溪县| 三都| 修水县| 赤城县| 丰城市| 临澧县| 名山县| 安宁市|