DropDownButton Data BindingPremium
The DropDownButton enables you to bind its popup to an array of strings or an array of objects through the items prop. Alternatively, you can declare the popup items as DropDownButtonItem child components.
Arrays of Primitive Data
The following example demonstrates how to bind the DropDownButton to an array of strings.
Arrays of Complex Data
When the DropDownButton is bound to complex data (objects), the component displays the text field of each item when it is defined. Otherwise, set textField to the name of the field that contains the display text. If an object has both text and the configured field, text takes precedence.
Data items can also set disabled, icon, svgIcon, iconClass, imageUrl, and render. For the complete list of item fields, see ButtonItem.
To customize the popup item content, see Item Templates.
The following example demonstrates how to bind the DropDownButton to object data.
Child Components
Use DropDownButtonItem child components when you want to declare popup items as children instead of supplying an array through items.
The following example demonstrates how to use the DropDownButtonItem child components to populate the popup items.