Normally the reactjs elements have the disabled attribute, I set it and the selectfields and inputs are grayed out, the user cannot edit them. In the case of DateTimeFieldWithLabel situation is different, disabled does not help. I found an API here , but judging by it, you can only make it disabled only on the selected dates.
I also need the entire piker to be disabled . Here I found out that there is a readOnly attribute, but it also did not work. Are there any options for implementing this?
Here is the code:
const DateTimeFieldWithLabel = React.createClass({ render: function () { var label = (this.props.label != null) ? this.props.label : ""; var name = (this.props.name != null) ? this.props.name : ""; var value = (this.props.value != null) ? this.props.value : ""; return ( <div className="datetimepicker input-group date "> <ControlLabel>{label}</ControlLabel> <DateTimeField datetime={value} name={name} onChange={this.props.onChange} readOnly={this.props.readOnly} /> </div> ); } }); And the code to use this element in the form renderer:
<div className="col-md-3 nopadding padding-right-xs"> <DateTimeFieldWithLabel label="Label" name='name' value={data.data} readOnly/> </div>