ui.data.ActiveDictionary
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คอนเทนเนอร์ที่คล้ายกับพจนานุกรมสำหรับข้อมูลที่จะใช้ในคอมโพเนนต์ UI
เมื่อมีการอัปเดตพร็อพเพอร์ตี้ของ ui.data.ActiveDictionary (เช่น myButton.style()) ระบบจะอัปเดตคอมโพเนนต์ที่พร็อพเพอร์ตี้นั้นเป็นของโดยอัตโนมัติ เช่น myButton.style().set('color', 'red') จะเปลี่ยนสีข้อความของปุ่มเป็นสีแดง
การใช้งาน | การคืนสินค้า |
---|
ui.data.ActiveDictionary(object, allowedProperties) | ui.data.ActiveDictionary |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
object | ออบเจ็กต์ (ไม่บังคับ) | ออบเจ็กต์ JavaScript ที่มีพร็อพเพอร์ตี้และค่าเพื่อเริ่มต้นออบเจ็กต์นี้ |
allowedProperties | List<String> ไม่บังคับ | อาร์เรย์ของพร็อพเพอร์ตี้ที่อนุญาตสำหรับออบเจ็กต์นี้ หากไม่ได้กำหนด ระบบจะอนุญาตให้ใช้พร็อพเพอร์ตี้ใดก็ได้ |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eui.data.ActiveDictionary is a container for storing data used by UI components, similar to a dictionary.\u003c/p\u003e\n"],["\u003cp\u003eChanges to an ActiveDictionary's properties automatically update the associated UI component, ensuring data and UI stay in sync.\u003c/p\u003e\n"],["\u003cp\u003eYou can create an ActiveDictionary using \u003ccode\u003eui.data.ActiveDictionary(object, allowedProperties)\u003c/code\u003e and optionally provide initial data and allowed properties.\u003c/p\u003e\n"]]],[],null,["# ui.data.ActiveDictionary\n\n\u003cbr /\u003e\n\nA dictionary-like container for data for use in UI components.\n\n\u003cbr /\u003e\n\nWhen a property of a ui.data.ActiveDictionary (e.g. myButton.style()) is updated, the component it belongs to is automatically updated. For example, myButton.style().set('color', 'red') would change the color of button's text to red.\n\n| Usage | Returns |\n|----------------------------------------------------------------|--------------------------|\n| `ui.data.ActiveDictionary(`*object* `, `*allowedProperties*`)` | ui.data.ActiveDictionary |\n\n| Argument | Type | Details |\n|---------------------|--------------------------|---------------------------------------------------------------------------------------------|\n| `object` | Object, optional | A JavaScript object with properties and values to initialize this object with. |\n| `allowedProperties` | List\\\u003cString\\\u003e, optional | An array of allowed properties for this object. If undefined, then any property is allowed. |"]]