Hi there. I am working with Kendo react forms and am rendering them via the map function. So, on render I call an api which returns a list of elements ( it can vary from 0 to 100+) and then I put it in a state. After that I do a map function and depending on the element id I render a Form Field like this:
component={
tada.tpodatka_id === 1 ?Input:
tada.tpodatka_id === 2 ?Input:
tada.tpodatka_id === 3 ?DatePicker:
tada.tpodatka_id === 4 ?DropDownList:
tada.tpodatka_id === 5 ?TextArea : // MultiLine
tada.tpodatka_id === 6 ?DropDownList:
tada.tpodatka_id === 7 ?DropDownList:
tada.tpodatka_id === 8 ?MultiSelect:
tada.tpodatka_id === 9 ?MultiSelect:
Input
}
That API, along with the element type, returns their current values. How can I assign on-render values to, for example, a dropdown or input in a Form? I tried this for a Input element but it didn't show the tada.txt_value on render:
<Field
required={tada.obavezan === 1 ? true : false}
name={tada.naziv}
component={ Input }
label={tada.naziv}
value={ tada.txt_value }
/>