แบบสำรวจการวิจัย: บอกให้เราทราบเกี่ยวกับประสบการณ์การใช้งาน Blockly
เริ่มแบบสำรวจ
ช่องที่กำหนดเอง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
แม้ว่า Blockly จะมีช่องที่เป็นประโยชน์มากมาย แต่แอปพลิเคชันของคุณอาจมีกรณีพิเศษอยู่ ลองทําตามขั้นตอนต่อไปนี้เมื่อปรับแต่งช่อง
อ่านเอกสารประกอบทุกช่องที่คล้ายกับที่ต้องการ ช่องเหล่านี้อาจมีอินเทอร์เฟซที่เป็นประโยชน์สําหรับการปรับแต่ง เช่น เมนูแบบเลื่อนลงมีฟังก์ชันการทํางานที่ซ่อนอยู่จํานวนมาก
ลองใช้เครื่องมือตรวจสอบเพื่อแก้ปัญหา
โปรแกรมตรวจสอบอนุญาตให้คุณยอมรับเฉพาะค่าบางค่า แก้ไขอินพุต หรือทริกเกอร์ฟังก์ชันเมื่อค่าของช่องมีการเปลี่ยนแปลง
ลองขยายช่อง
หากช่องแสดงถึงประเภทค่าที่คุณต้องการ แต่ต้องการแก้ไขตัวแก้ไข ลักษณะที่ปรากฏ หรือข้อความที่แสดงช่องนั้น คุณสามารถสร้างคลาสย่อยที่รับช่วงฟังก์ชันการทํางานจํานวนมากไปพร้อมกับลบล้างส่วนที่ต้องการเปลี่ยนแปลง
สร้างช่องประเภทใหม่
แม้ว่าตัวเลือกนี้เป็นตัวเลือกที่มีประสิทธิภาพมากที่สุด แต่ก็จะใช้เวลามากที่สุดด้วย และโดยทั่วไปก็ควรใช้ในกรณีที่คุณต้องการจัดเก็บประเภทค่าใหม่เท่านั้น
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[null,null,["อัปเดตล่าสุด 2025-07-25 UTC"],[[["\u003cp\u003eBlockly offers customization options beyond its built-in fields, allowing developers to tailor fields to their specific needs.\u003c/p\u003e\n"],["\u003cp\u003eBefore creating a new field type, explore existing fields, validators, and extension capabilities for potential solutions.\u003c/p\u003e\n"],["\u003cp\u003eLeverage validators to control accepted values, modify input, or trigger actions based on field value changes.\u003c/p\u003e\n"],["\u003cp\u003eExtend existing fields to modify their editor, appearance, or displayed text while inheriting core functionality.\u003c/p\u003e\n"],["\u003cp\u003eCreating a new field type is the most powerful but time-intensive option, reserved for storing new value types.\u003c/p\u003e\n"]]],["Customizing Blockly fields involves several steps: First, review documentation of similar fields for potential customization options. Second, use validators to control accepted values, modify input, or trigger actions upon value changes. Third, extend existing fields by creating subclasses to modify their editor, appearance, or displayed text. Finally, create a new field type for storing novel value types, though this is the most complex option.\n"],null,["# Custom fields\n\nWhile Blockly provides many useful fields, your application may have a\nspecialized case. Here are a few steps to take when customizing fields:\n\n1. Read the documentation of any fields similar to what you require; they may\n provide a useful interface for customization. For example,\n [dropdowns](/blockly/guides/create-custom-blocks/fields/built-in-fields/dropdown) have a lot of hidden functionality.\n\n2. Consider using a [validator](/blockly/guides/create-custom-blocks/fields/validators) to solve your problem.\n Validators allow you to only accept certain values, modify input, or trigger\n functionality when a field's value changes.\n\n3. Consider [extending a field](/blockly/guides/create-custom-blocks/fields/customizing-fields/extending).\n If there is a field that represents the value type you require, but you want to\n modify its [editor](/blockly/guides/create-custom-blocks/fields/anatomy-of-a-field#editor_display), its\n [appearance](/blockly/guides/create-custom-blocks/fields/anatomy-of-a-field#on-block_display), or the\n [text](/blockly/guides/create-custom-blocks/fields/customizing-fields/creating#text) it\n displays, you can [create a subclass](/blockly/guides/create-custom-blocks/fields/customizing-fields/extending#subclassing)\n that inherits the bulk of the functionality, while overriding the specific parts\n you want to change.\n\n4. [Create a new field type](/blockly/guides/create-custom-blocks/fields/customizing-fields/creating).\n While this is the most powerful option, it is also the most time consuming, and\n should generally only be used if you need to store a new value type."]]