Class GridItem
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
গ্রিড আইটেম আইটেম ব্যবহারকারীরা একটি গ্রিড উইজেটের মধ্যে ইন্টারঅ্যাক্ট করে।
Google Workspace অ্যাড-অন এবং Google Chat অ্যাপের জন্য উপলভ্য।
একটি enum কল করার জন্য, আপনি তার পিতামাতার শ্রেণী, নাম এবং সম্পত্তি কল করুন। উদাহরণস্বরূপ, CardService.GridItemLayout.TEXT_BELOW
।
const gridItem = CardService.newGridItem()
.setIdentifier('itemA')
.setTitle('This is a cat')
.setImage(CardService.newImageComponent())
.setLayout(CardService.GridItemLayout.TEXT_BELOW);
বিস্তারিত ডকুমেন্টেশন
set Identifier(id)
গ্রিড আইটেমের জন্য শনাক্তকারী সেট করে। যখন একজন ব্যবহারকারী এই গ্রিড আইটেমটিতে ক্লিক করেন, তখন এই আইডিটি প্যারেন্ট গ্রিডের on_click কল ব্যাক প্যারামিটারে ফেরত দেওয়া হয়।
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
id | String | আইডি। |
প্রত্যাবর্তন
Grid Item
— এই বস্তু, চেইনিং জন্য.
set Image(image)
এই গ্রিড আইটেমের জন্য ইমেজ সেট করে।
পরামিতি
প্রত্যাবর্তন
Grid Item
— এই বস্তু, চেইনিং জন্য.
set Layout(layout)
গ্রিড আইটেমের জন্য পাঠ্য এবং চিত্রের বিন্যাস সেট করে। ডিফল্ট হল TEXT_BELOW৷
পরামিতি
প্রত্যাবর্তন
Grid Item
— এই বস্তু, চেইনিং জন্য.
set Subtitle(subtitle)
গ্রিড আইটেমের সাবটাইটেল সেট করে।
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
subtitle | String | সাবটাইটেল টেক্সট. |
প্রত্যাবর্তন
Grid Item
— এই বস্তু, চেইনিং জন্য.
set Text Alignment(alignment)
গ্রিড আইটেমের অনুভূমিক প্রান্তিককরণ সেট করে। ডিফল্ট হল START।
পরামিতি
প্রত্যাবর্তন
Grid Item
— এই বস্তু, চেইনিং জন্য.
set Title(title)
গ্রিড আইটেমের শিরোনাম পাঠ্য সেট করে।
পরামিতি
নাম | টাইপ | বর্ণনা |
---|
title | String | শিরোনাম পাঠ্য। |
প্রত্যাবর্তন
Grid Item
— এই বস্তু, চেইনিং জন্য.
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট 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\u003eGridItem represents interactive elements within a grid widget, usable in Google Workspace Add-ons and Chat apps.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can set an identifier, image, layout, subtitle, text alignment, and title for each GridItem.\u003c/p\u003e\n"],["\u003cp\u003eWhen a user clicks a GridItem, its identifier is returned in the parent grid's on_click callback, enabling interactive functionality.\u003c/p\u003e\n"],["\u003cp\u003eGridItem leverages \u003ccode\u003eCardService\u003c/code\u003e methods for customization, such as \u003ccode\u003esetTitle()\u003c/code\u003e, \u003ccode\u003esetImage()\u003c/code\u003e, and \u003ccode\u003esetLayout()\u003c/code\u003e, to define its appearance and behavior.\u003c/p\u003e\n"],["\u003cp\u003eDefault settings include TEXT_BELOW for layout and START for text alignment, offering a base configuration for GridItems.\u003c/p\u003e\n"]]],["Grid items, used in grid widgets for Google Workspace add-ons and Chat apps, are configured using methods like `setIdentifier`, `setImage`, `setLayout`, `setSubtitle`, `setTextAlignment`, and `setTitle`. These methods respectively assign an ID, an image, a text/image layout, a subtitle, text alignment, and a title. The `setIdentifier` method's ID is returned upon a user click. Default layout is `TEXT_BELOW` and the default alignment is `START`. Each method returns the `GridItem` object, enabling chaining.\n"],null,["# Class GridItem\n\nGridItem\n\nThe items users interact with within a grid widget.\n\nAvailable for Google Workspace add-ons and Google Chat apps.\n\nTo call an enum, you call its parent class, name, and property. For example, `\nCardService.GridItemLayout.TEXT_BELOW`.\n\n```javascript\nconst gridItem = CardService.newGridItem()\n .setIdentifier('itemA')\n .setTitle('This is a cat')\n .setImage(CardService.newImageComponent())\n .setLayout(CardService.GridItemLayout.TEXT_BELOW);\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------------------------|---------------|------------------------------------------------------|\n| [setIdentifier(id)](#setIdentifier(String)) | [GridItem](#) | Sets the identifier for the grid item. |\n| [setImage(image)](#setImage(ImageComponent)) | [GridItem](#) | Sets the image for this grid item. |\n| [setLayout(layout)](#setLayout(GridItemLayout)) | [GridItem](#) | Sets the layout of text and image for the grid item. |\n| [setSubtitle(subtitle)](#setSubtitle(String)) | [GridItem](#) | Sets the subtitle of the grid item. |\n| [setTextAlignment(alignment)](#setTextAlignment(HorizontalAlignment)) | [GridItem](#) | Sets the horizontal alignment of the grid item. |\n| [setTitle(title)](#setTitle(String)) | [GridItem](#) | Sets the title text of the grid item. |\n\nDetailed documentation\n----------------------\n\n### `set``Identifier(id)`\n\nSets the identifier for the grid item. When a user clicks this grid item, this ID is returned\nin the parent grid's on_click call back parameters.\n\n#### Parameters\n\n| Name | Type | Description |\n|------|----------|-------------|\n| `id` | `String` | The ID. |\n\n#### Return\n\n\n[GridItem](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Image(image)`\n\nSets the image for this grid item.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|-----------------------------------------------------------------------|----------------------------|\n| `image` | [ImageComponent](/apps-script/reference/card-service/image-component) | The ImageComponent object. |\n\n#### Return\n\n\n[GridItem](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Layout(layout)`\n\nSets the layout of text and image for the grid item. Default is TEXT_BELOW\n\n#### Parameters\n\n| Name | Type | Description |\n|----------|------------------------------------------------------------------------|---------------------|\n| `layout` | [GridItemLayout](/apps-script/reference/card-service/grid-item-layout) | The layout setting. |\n\n#### Return\n\n\n[GridItem](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Subtitle(subtitle)`\n\nSets the subtitle of the grid item.\n\n#### Parameters\n\n| Name | Type | Description |\n|------------|----------|--------------------|\n| `subtitle` | `String` | The subtitle text. |\n\n#### Return\n\n\n[GridItem](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Text``Alignment(alignment)`\n\nSets the horizontal alignment of the grid item. Default is START.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------|---------------------------------------------------------------------------------|------------------------|\n| `alignment` | [HorizontalAlignment](/apps-script/reference/card-service/horizontal-alignment) | The alignment setting. |\n\n#### Return\n\n\n[GridItem](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Title(title)`\n\nSets the title text of the grid item.\n\n#### Parameters\n\n| Name | Type | Description |\n|---------|----------|-----------------|\n| `title` | `String` | The title text. |\n\n#### Return\n\n\n[GridItem](#) --- This object, for chaining."]]