ui.data.ActiveList.set
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตั้งค่าองค์ประกอบที่ดัชนีที่ระบุ หากดัชนีเกินดัชนีขององค์ประกอบสุดท้ายในรายการ ระบบจะเพิ่มองค์ประกอบไว้ที่ท้ายรายการ
แสดงผล ui.data.ActiveList นี้
การใช้งาน | การคืนสินค้า |
---|
ActiveList.set(index, el) | ui.data.ActiveList |
อาร์กิวเมนต์ | ประเภท | รายละเอียด |
---|
ดังนี้ ui.data.activelist | ui.data.ActiveList | อินสแตนซ์ ui.data.ActiveList |
index | ตัวเลข | ดัชนีที่จะเขียนทับ |
el | วัตถุ | องค์ประกอบที่จะตั้งค่า |
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[[["\u003cp\u003eThe \u003ccode\u003eset\u003c/code\u003e method allows modification of an element at a specific index within a \u003ccode\u003eui.data.ActiveList\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIf the given index is beyond the current list's bounds, the provided element is appended to the end.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eset\u003c/code\u003e returns the original \u003ccode\u003eui.data.ActiveList\u003c/code\u003e instance, enabling method chaining.\u003c/p\u003e\n"]]],[],null,["# ui.data.ActiveList.set\n\n\u003cbr /\u003e\n\nSets an element at the specified index. If the index exceeds that of the list's last element, the element will be added to the end of the list.\n\n\u003cbr /\u003e\n\nReturns this ui.data.ActiveList.\n\n| Usage | Returns |\n|-----------------------------|--------------------|\n| ActiveList.set`(index, el)` | ui.data.ActiveList |\n\n| Argument | Type | Details |\n|----------------------------|--------------------|----------------------------------|\n| this: `ui.data.activelist` | ui.data.ActiveList | The ui.data.ActiveList instance. |\n| `index` | Number | The index to overwrite. |\n| `el` | Object | The element to set. |"]]