Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Dropdown field initialized with options

24 views
Skip to first unread message

Max Stephen Russell

unread,
Nov 23, 2024, 8:55:31 PM11/23/24
to Blockly
If I want to have a dropdown in my toolbox with the 50 U.S. states as its options, am I correct in thinking that it will qualify as a “Simple Dropdown” like the example below (from the guide), and this Note: Prefix/suffix matching does not occur for dynamic dropdowns. will not apply to my situation?

Thank you.

Steve
-----------
{ "type": "example_dropdown", "message0": "drop down: %1", "args0": [ { "type": "field_dropdown", "name": "FIELDNAME", "options": [ [ "first item", "ITEM1" ], [ "second item", "ITEM2" ] ] } ] }

Mark Friedman

unread,
Nov 24, 2024, 6:52:20 PM11/24/24
to blo...@googlegroups.com
Hi Steve,

  As long as you put all the states in the options array in your JSON for the block then yes, it qualifies as a simple dropdown.  The thing that distinguishes between simple and dynamic dropdowns is that a simple dropdown has a single unchanging set of options, whereas a dynamic dropdown uses a function to regenerate the options each time you click on the dropdown,

  In your case prefix/suffix matching won't happen because there isn't any common prefix or suffix among all 50 states.

  Hope this helps.

-Mark


--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/blockly/e3e18929-bba0-40ce-b584-00938907d5a1n%40googlegroups.com.

Max Stephen Russell

unread,
Nov 24, 2024, 7:02:17 PM11/24/24
to blo...@googlegroups.com
Grrreat, thank you, Mark. That’s what I wanted to hear, because I do in fact have prefixes.

-Steve

Reply all
Reply to author
Forward
0 new messages