Closed danielkay closed 8 years ago
if the 'values' key exists when looping through the options array, then we can assume that 'label' refers to the label of an optgroup. Thereby the following structure will map to a select menu with optgroups:
[ {label: "Option One", value: "option1"}, { label: "OptGroup One", values: [ {label: "Option Two", value: "option2"}, {label: "Option Three", value: "option3"} ] }, { label: "OptGroup Two", values: [ {label: "Option Four", value: "option4"}, {label: "Option Five", value: "option5"} ] }, {label: "Option Six", value: "option6"}, ]
if the 'values' key exists when looping through the options array, then we can assume that 'label' refers to the label of an optgroup. Thereby the following structure will map to a select menu with optgroups: