Enum ButtonSet
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
বোতাম সেট একটি enum প্রতিনিধিত্ব করে পূর্বনির্ধারিত, এক বা একাধিক ডায়ালগ বোতামের স্থানীয় সেট যা একটি alert
বা একটি prompt
যোগ করা যেতে পারে। ব্যবহারকারী কোন বোতামটি ক্লিক করেছেন তা নির্ধারণ করতে, Button
ব্যবহার করুন।
একটি enum কল করার জন্য, আপনি তার পিতামাতার শ্রেণী, নাম এবং সম্পত্তি কল করুন। উদাহরণস্বরূপ, Base.ButtonSet.OK
।
// Display a dialog box with a message and "Yes" and "No" buttons.
const ui = DocumentApp.getUi();
const response = ui.alert(
'Are you sure you want to continue?',
ui.ButtonSet.YES_NO,
);
// Process the user's response.
if (response === ui.Button.YES) {
Logger.log('The user clicked "Yes."');
} else {
Logger.log('The user clicked "No" or the dialog\'s close button.');
}
বৈশিষ্ট্য
সম্পত্তি | টাইপ | বর্ণনা |
---|
OK | Enum | একটি একক "ঠিক আছে" বোতাম, একটি তথ্যমূলক বার্তা নির্দেশ করে যা শুধুমাত্র খারিজ করা যেতে পারে। |
OK_CANCEL | Enum | একটি "ঠিক আছে" বোতাম এবং একটি "বাতিল" বোতাম, যা ব্যবহারকারীকে হয় একটি অপারেশনের সাথে এগিয়ে যেতে বা থামাতে দেয়৷ |
YES_NO | Enum | একটি "হ্যাঁ" বোতাম এবং একটি "না" বোতাম, ব্যবহারকারীকে হ্যাঁ/না প্রশ্নের উত্তর দিতে দেয়৷ |
YES_NO_CANCEL | Enum | একটি "হ্যাঁ" বোতাম, একটি "না" বোতাম এবং একটি "বাতিল" বোতাম, যা ব্যবহারকারীকে হ্যাঁ/না প্রশ্নের উত্তর দিতে বা একটি অপারেশন বন্ধ করতে দেয়৷ |
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-24 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003e\u003ccode\u003eButtonSet\u003c/code\u003e is an enum used to create predefined, localized button sets for dialog boxes in Apps Script.\u003c/p\u003e\n"],["\u003cp\u003eIt provides options like \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eOK_CANCEL\u003c/code\u003e, \u003ccode\u003eYES_NO\u003c/code\u003e, and \u003ccode\u003eYES_NO_CANCEL\u003c/code\u003e for different dialog scenarios.\u003c/p\u003e\n"],["\u003cp\u003eYou can determine the user's button click by comparing the response to \u003ccode\u003eui.Button\u003c/code\u003e values.\u003c/p\u003e\n"],["\u003cp\u003eThese button sets are used with \u003ccode\u003ealert()\u003c/code\u003e and \u003ccode\u003eprompt()\u003c/code\u003e methods of the \u003ccode\u003eUi\u003c/code\u003e class.\u003c/p\u003e\n"]]],[],null,["# Enum ButtonSet\n\nButtonSet\n\nAn enum representing predetermined, localized sets of one or more dialog buttons that can be\nadded to an [alert](/apps-script/reference/base/ui#alert(String,ButtonSet)) or a [prompt](/apps-script/reference/base/ui#prompt(String,ButtonSet)). To determine which button the user clicked,\nuse [Button](/apps-script/reference/base/button).\n\nTo call an enum, you call its parent class, name, and property. For example, `\nBase.ButtonSet.OK`.\n\n```javascript\n// Display a dialog box with a message and \"Yes\" and \"No\" buttons.\nconst ui = DocumentApp.getUi();\nconst response = ui.alert(\n 'Are you sure you want to continue?',\n ui.ButtonSet.YES_NO,\n);\n\n// Process the user's response.\nif (response === ui.Button.YES) {\n Logger.log('The user clicked \"Yes.\"');\n} else {\n Logger.log('The user clicked \"No\" or the dialog\\'s close button.');\n}\n``` \n\n### Properties\n\n| Property | Type | Description |\n|-----------------|--------|----------------------------------------------------------------------------------------------------------------------------------|\n| `OK` | `Enum` | A single \"OK\" button, indicating an informational message that can only be dismissed. |\n| `OK_CANCEL` | `Enum` | An \"OK\" button and a \"Cancel\" button, allowing the user to either proceed with or halt an operation. |\n| `YES_NO` | `Enum` | A \"Yes\" button and a \"No\" button, allowing the user to answer a yes/no question. |\n| `YES_NO_CANCEL` | `Enum` | A \"Yes\" button, a \"No\" button, and a \"Cancel\" button, allowing the user to either answer a yes/no question or halt an operation. |"]]