In your Chapter 04 video #3
I'm trying to change this JSX from:
<select className="form-control" defaultValue={newItem.typeStr} onChange={(e) => onFieldChange(e, "typeStr")} name="itemType">
{itemTypesProvider.map((t) => {
return (
<option key={t} value={t}>
{t}
</option>
);
})}
</select>
To its equivalent:
<DropDownList
data={itemTypesProvider} defaultValue={newItem.typeStr}
onChange={(e) => onFieldChange(e, "typeStr")}
name="itemType"></DropDownList>
As you can see, the expression to map the itemTypesProvider array is missing from the KendoReact component.
Adding a child, between the the <DropDownList></DropDownList> tags is not permitted.
<DropDownList
data={itemTypesProvider} defaultValue={newItem.typeStr}
onChange={(e) => onFieldChange(e, "typeStr")}
name="itemType">Anything between the opening and closing tags results in an error</DropDownList>
(Please see attachment)
How do I get the itemTypesProvider items to populate my DropDownList?
Hi, Doug,
The DropDownList does not have a children prop and its values are passed to its `data` property which you applied in the example.
I can understand that you were able to fix the issue. Is this correct? If you require further help with the DropDownList, please let me know.
Regards,Wissam
Progress Telerik
Wissam,
Yes, I was able to fix the issue.
Doug