Suggestion for DropDownCommandInput.listItems items
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
When using a DropDown command input in Fusion360, every item on it is added with name attribute as the only data reference for the item:
returnValue = listItems_var.add(name, isSelected, icon, beforeIndex)
That name should be clear enough to the user to choose from the list and also should keep an internal reference to some action or data structure.
Sometimes I need to keep some more information about the item and a parallel dictionary or other data structure is required for it.
My suggestion is to add a reference (any name you choose) attribute to the listItem, as you did with a command Definition, where you find id (for internal use) and name (visible on the user interface). This also apply to RadioButtonGroupCommandInput's listItems.
Think of as an option's element in HTML where you have the text element displayed to the user and the value attribute for internal reference:
<select id="pet-select">
<option value="">--Please a pet--</option>
<option value="31">Dog</option>
<option value="32">Cat</option>
<option value="33">Hamster</option>
<option value="44">Parrot</option>
<option value="55">Spider</option>
<option value="76">Goldfish</option>
</select>
Hope this could be analyzed by Autodesk team to be included in some next version.
Regards,
Jorge