blockly > FieldVariable > dropdownCreate
FieldVariable.dropdownCreate() method
Return a sorted list of variable names for variable dropdown menus. Include a special option at the end for creating a new variable name.
Signature:
static dropdownCreate(this: FieldVariable): MenuOption[];
Parameters
Returns:
MenuOption[]
Array of variable names/id tuples.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `dropdownCreate()` method generates a dropdown menu of variable names for use in Blockly blocks."],["This method returns an array of options including existing variable names and an option to create a new variable."],["The options are formatted as `MenuOption` objects and are suitable for use in variable selection dropdowns within Blockly."]]],[]]