Enum OnClose
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เปิดปิด
อาร์เรย์แบบจำกัดที่ระบุสิ่งที่ต้องทำเมื่อปิด URL ที่เปิดผ่าน OpenLink
เมื่อเปิดลิงก์ ไคลเอ็นต์จะลืมลิงก์นั้นหรือรอจนกว่าหน้าต่างจะปิด
การติดตั้งใช้งานจะขึ้นอยู่กับความสามารถของแพลตฟอร์มไคลเอ็นต์ OnClose
อาจทําให้ระบบละเว้น OpenAs
หากแพลตฟอร์มไคลเอ็นต์ไม่รองรับทั้ง 2 ค่าที่เลือกไว้ด้วยกัน
OnClose
จะมีความสําคัญเหนือกว่า
หากต้องการเรียกใช้ enum ให้เรียกคลาสหลัก ชื่อ และพร็อพเพอร์ตี้ของ enum นั้น เช่น
CardService.OnClose.RELOAD
พร็อพเพอร์ตี้
พร็อพเพอร์ตี้ | ประเภท | คำอธิบาย |
NOTHING | Enum | ไม่ทำอะไรเมื่อปิด ค่าเริ่มต้น |
RELOAD | Enum | โหลดส่วนเสริมซ้ำเมื่อหน้าต่างปิด
หากตั้งค่า OpenAs.OVERLAY ด้วย ระบบจะบล็อกการ์ดหลักจนกว่าหน้าต่างวางซ้อนจะปิดลงและส่วนเสริมโหลดซ้ำเสร็จแล้ว
|
พร็อพเพอร์ตี้ที่เลิกใช้งานแล้ว
พร็อพเพอร์ตี้ | ประเภท | คำอธิบาย |
RELOAD_ADD_ON | Enum | โหลดส่วนเสริมซ้ำเมื่อปิด URL การดำเนินการนี้แตกต่างจาก RELOAD ตรงที่ไม่บล็อกการ์ดหลักขณะแสดงหน้าต่าง OpenAs.OVERLAY |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 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. |"]]