Enum Button
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
বোতাম পূর্বনির্ধারিত, স্থানীয়করণকৃত ডায়ালগ বোতামের প্রতিনিধিত্বকারী একটি enum একটি alert
বা Prompt Response.getSelectedButton()
দ্বারা প্রত্যাবর্তিত হয় যাতে ব্যবহারকারী একটি ডায়ালগে কোন বোতামটি ক্লিক করেছে তা নির্দেশ করে৷ এই মান সেট করা যাবে না; একটি alert
বা prompt
বোতাম যোগ করতে, পরিবর্তে Button Set
ব্যবহার করুন।
একটি enum কল করার জন্য, আপনি তার পিতামাতার শ্রেণী, নাম এবং সম্পত্তি কল করুন। উদাহরণস্বরূপ, Base.Button.CLOSE
।
// 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.');
}
বৈশিষ্ট্য
সম্পত্তি | টাইপ | বর্ণনা |
---|
CLOSE | Enum | প্রতিটি ডায়ালগের শিরোনাম বারে প্রদর্শিত আদর্শ বন্ধ বোতাম। এই বোতামটি স্পষ্টভাবে একটি ডায়ালগে যোগ করা হয়নি, এবং এটি সরানো যাবে না। |
OK | Enum | একটি "ঠিক আছে" বোতাম, নির্দেশ করে যে একটি অপারেশন এগিয়ে যেতে হবে। |
CANCEL | Enum | একটি "বাতিল" বোতাম, নির্দেশ করে যে একটি অপারেশন এগিয়ে যাওয়া উচিত নয়৷ |
YES | Enum | একটি "হ্যাঁ" বোতাম, একটি প্রশ্নের ইতিবাচক প্রতিক্রিয়া নির্দেশ করে। |
NO | 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\u003eButton\u003c/code\u003e is an enum representing localized dialog buttons returned by alerts or prompts, indicating user action.\u003c/p\u003e\n"],["\u003cp\u003eThese predetermined button values (\u003ccode\u003eCLOSE\u003c/code\u003e, \u003ccode\u003eOK\u003c/code\u003e, \u003ccode\u003eCANCEL\u003c/code\u003e, \u003ccode\u003eYES\u003c/code\u003e, \u003ccode\u003eNO\u003c/code\u003e) cannot be set directly but are accessed via \u003ccode\u003eui.Button\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo add buttons to alerts or prompts, use \u003ccode\u003eButtonSet\u003c/code\u003e instead of individual \u003ccode\u003eButton\u003c/code\u003e values.\u003c/p\u003e\n"],["\u003cp\u003eThe provided example code demonstrates using \u003ccode\u003eButton\u003c/code\u003e to handle user responses from a dialog.\u003c/p\u003e\n"]]],[],null,["# Enum Button\n\nButton\n\nAn enum representing predetermined, localized dialog buttons returned by an [alert](/apps-script/reference/base/ui#alert(String)) or [PromptResponse.getSelectedButton()](/apps-script/reference/base/prompt-response#getSelectedButton()) to indicate\nwhich button in a dialog the user clicked. These values cannot be set; to add buttons to an\n[alert](/apps-script/reference/base/ui#alert(String,ButtonSet)) or [prompt](/apps-script/reference/base/ui#prompt(String,ButtonSet)), use [ButtonSet](/apps-script/reference/base/button-set) instead.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nBase.Button.CLOSE`.\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| `CLOSE` | `Enum` | The standard close button displayed in every dialog's title bar. This button is not explicitly added to a dialog, and it cannot be removed. |\n| `OK` | `Enum` | An \"OK\" button, indicating that an operation should proceed. |\n| `CANCEL` | `Enum` | A \"Cancel\" button, indicating that an operation should not proceed. |\n| `YES` | `Enum` | A \"Yes\" button, indicating a positive response to a question. |\n| `NO` | `Enum` | A \"No\" button, indicating a negative response to a question. |"]]