ui.Select
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
תפריט בחירה שניתן להדפסה עם קריאה חוזרת.
שימוש | החזרות |
---|
ui.Select(items, placeholder, value, onChange, disabled, style) | ui.Select |
ארגומנט | סוג | פרטים |
---|
items | List<Object>, אופציונלי | רשימת האפשרויות להוספה לרכיב select. ברירת המחדל היא מערך ריק. |
placeholder | מחרוזת, אופציונלי | ה-placeholder שמוצג כשלא נבחר ערך. ברירת המחדל היא 'עליך לבחור ערך...'. |
value | מחרוזת, אופציונלי | הערך של רכיב ה-select. ברירת המחדל היא null. |
onChange | פונקציה, אופציונלי | הקריאה החוזרת (callback) שמופעלת כשבוחרים פריט. הקריאה החוזרת מקבלת את הערך שנבחר כרגע ואת הווידג'ט של רשימת הבחירה. |
disabled | בוליאני, אופציונלי | האם הרכיב select מושבת. ברירת המחדל היא False. |
style | אובייקט, אופציונלי | אובייקט של סגנונות CSS מותרים עם הערכים שיוגדרו לווידג'ט הזה. מידע נוסף זמין במסמכי התיעוד של הפונקציה style(). |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-25 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-25 (שעון UTC)."],[[["\u003cp\u003eCreate a customizable select menu with \u003ccode\u003eui.Select()\u003c/code\u003e by providing items, placeholder, initial value, and styles.\u003c/p\u003e\n"],["\u003cp\u003eDefine an \u003ccode\u003eonChange\u003c/code\u003e callback function to execute actions when a user selects an item from the menu, receiving the selected value and the select widget.\u003c/p\u003e\n"],["\u003cp\u003eUtilize optional parameters like \u003ccode\u003edisabled\u003c/code\u003e to control interactivity and \u003ccode\u003estyle\u003c/code\u003e to modify the appearance of the select menu.\u003c/p\u003e\n"]]],[],null,["# ui.Select\n\n\u003cbr /\u003e\n\nA printable select menu with a callback.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------------|-----------|\n| `ui.Select(`*items* `, `*placeholder* `, `*value* `, `*onChange* `, `*disabled* `, `*style*`)` | ui.Select |\n\n| Argument | Type | Details |\n|---------------|--------------------------|---------------------------------------------------------------------------------------------------------------------------|\n| `items` | List\\\u003cObject\\\u003e, optional | The list of options to add to the select. Defaults to an empty array. |\n| `placeholder` | String, optional | The placeholder shown when no value is selected. Defaults to \"Select a value...\". |\n| `value` | String, optional | The select's value. Defaults to null. |\n| `onChange` | Function, optional | The callback to fire when an item is selected. The callback is passed the currently selected value and the select widget. |\n| `disabled` | Boolean, optional | Whether the select is disabled. Defaults to false. |\n| `style` | Object, optional | An object of allowed CSS styles with their values to be set for this widget. See style() documentation. |"]]