Enum OnClose
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
OnClose
Một enum chỉ định việc cần làm khi một URL được mở thông qua OpenLink
bị đóng.
Khi một đường liên kết được mở, ứng dụng khách sẽ quên đường liên kết đó hoặc đợi cho đến khi cửa sổ đóng lại.
Việc triển khai phụ thuộc vào các tính năng của nền tảng ứng dụng. OnClose
có thể khiến OpenAs
bị bỏ qua; nếu nền tảng ứng dụng không thể hỗ trợ cả hai giá trị đã chọn cùng một lúc, thì OnClose
sẽ được ưu tiên.
Để gọi một enum, bạn gọi lớp mẹ, tên và thuộc tính của enum đó. Ví dụ:
CardService.OnClose.RELOAD
.
Thuộc tính
Thuộc tính | Loại | Mô tả |
NOTHING | Enum | Không làm gì khi đóng. Mặc định. |
RELOAD | Enum | Tải lại tiện ích bổ sung khi cửa sổ đóng.
Nếu bạn cũng đặt OpenAs.OVERLAY , thì thẻ chính sẽ bị chặn cho đến khi cửa sổ lớp phủ đóng và tiện ích bổ sung tải lại xong.
|
Thuộc tính không còn hoạt động
Thuộc tính | Loại | Mô tả |
RELOAD_ADD_ON | Enum | Tải lại tiện ích bổ sung khi đóng URL. Thao tác này khác với RELOAD ở chỗ thao tác này không chặn thẻ chính trong khi hiển thị cửa sổ OpenAs.OVERLAY . |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eOnClose\u003c/code\u003e is an enum used within \u003ccode\u003eOpenLink\u003c/code\u003e to specify an action taken when the opened URL is closed by the user.\u003c/p\u003e\n"],["\u003cp\u003eIt offers options like \u003ccode\u003eNOTHING\u003c/code\u003e (default) and \u003ccode\u003eRELOAD\u003c/code\u003e to reload the add-on upon closing the URL, with \u003ccode\u003eRELOAD\u003c/code\u003e potentially blocking the main card if used with \u003ccode\u003eOpenAs.OVERLAY\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eAlthough previously available, the \u003ccode\u003eRELOAD_ADD_ON\u003c/code\u003e option is now deprecated and should not be used in new developments.\u003c/p\u003e\n"]]],[],null,["# Enum OnClose\n\nOnClose\n\nAn enum that specifies what to do when a URL opened through an [OpenLink](/apps-script/reference/card-service/open-link) is closed.\n\nWhen a link is opened, the client either forgets about it or waits until the window is closed.\nThe implementation depends on the client platform capabilities. [OnClose](#) may cause [OpenAs](/apps-script/reference/card-service/open-as) to be ignored; if the client platform cannot support both selected values together,\n[OnClose](#) takes precedence.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.OnClose.RELOAD`. \n\n### Properties\n\n| Property | Type | Description |\n|-----------|--------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `NOTHING` | `Enum` | Do nothing on close. Default. |\n| `RELOAD` | `Enum` | Reloads the add-on on when the window closes. If [OpenAs.OVERLAY](/apps-script/reference/card-service/open-as#OVERLAY) is also set, then the main card is blocked until the overlay window is closed and the add-on has finished reloading. |\n\n### Deprecated properties\n\n| Property | Type | Description |\n|-----------------|--------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `RELOAD_ADD_ON` | `Enum` | Reload the add-on on closing the URL. This action differs from [RELOAD](#RELOAD) in that it does not block the main card while showing an [OpenAs.OVERLAY](/apps-script/reference/card-service/open-as#OVERLAY) window. |"]]