Use Kendo UI Core widgets in a React application
These wrappers are designed as drop-in React components. Use as follows:
render: function () {
return (
<div>
<KW.DatePicker
value={this.state.myDate}
onChange={this._onChangeMyDate} />
</div>
);
},
// note this will be called with the new value as the argument, not an event
_onChangeMyDate: function (value) {
this.setState({ myDate: value });
}
The library makes an instance of the widget only once in componentDidMount, and then new props are used to update the existing widget whenever possible. The goal is to have the widget behave in a stateless fashion but still have pretty good performance.
You must include all props that should not revert to the widget defaults on every render. The components do not keep any internal React state and are not designed to persist configuration between renders.
-
Button
enabled
prop useswidget.enable()
icon
prop useswidget.setOptions()
onClick
prop is a callback that runs onclick
event
-
DatePicker
value
prop useswidget.value()
max
prop useswidget.setOptions()
min
prop useswidget.setOptions()
format
prop useswidget.setOptions()
enabled
prop useswidget.enable()
readonly
prop useswidget.readonly()
width
prop sets useswidget.wrapper.css()
to set the widthonChange
prop is a callback that runs onchange
event
-
DateTimePicker
value
prop useswidget.value()
max
prop useswidget.setOptions()
min
prop useswidget.setOptions()
format
prop useswidget.setOptions()
enabled
prop useswidget.enable()
readonly
prop useswidget.readonly()
width
prop sets useswidget.wrapper.css()
to set the widthonChange
prop is a callback that runs onchange
event
-
MaskedTextBox
value
prop useswidget.value()
enabled
prop useswidget.enable()
readonly
prop useswidget.readonly()
mask
prop rebuilds the widget on changerules
prop rebuilds the widget on changewidth
prop sets useswidget.wrapper.css()
to set the widthonChange
prop is a callback that runs onchange
event
-
NumericTextBox
value
prop useswidget.value()
max
prop useswidget.max()
min
prop useswidget.min()
step
prop useswidget.step()
enabled
prop useswidget.enable()
readonly
prop useswidget.readonly()
format
prop manually setswidget.options
and triggers an updatewidth
prop sets useswidget.wrapper.css()
to set the widthonChange
prop is a callback that runs onchange
andspin
events
-
DropDownList
value
prop useswidget.value()
text
prop useswidget.text()
enabled
prop useswidget.enable()
readonly
prop useswidget.readonly()
data
prop useswidget.setDataSource()
filter
prop manually setswidget.options
and triggers an updatedataTextField
prop rebuilds the widget on changedataValueField
prop rebuilds the widget on changewidth
prop sets useswidget.wrapper.css()
to set the widthonChange
prop is a callback that runs onchange
event
-
ComboBox
value
prop useswidget.value()
text
prop useswidget.text()
enabled
prop useswidget.enable()
readonly
prop useswidget.readonly()
data
prop useswidget.setDataSource()
filter
prop manually setswidget.options
and triggers an updatedataTextField
prop rebuilds the widget on changedataValueField
prop rebuilds the widget on changewidth
prop sets useswidget.wrapper.css()
to set the widthonChange
prop is a callback that runs onchange
event
In Kendo, calling widget.enable(true)
overwrites the current value of readonly
(setting it to false
), and calling widget.readonly(false)
overwrites the current value of enabled
(setting it to true
). Therefore, you should only use readonly
or enabled
, but not both. Otherwise you might have unexpected results.