diff --git a/examples/range.js b/examples/range.js index dcc332b..2cd9a73 100644 --- a/examples/range.js +++ b/examples/range.js @@ -14,17 +14,41 @@ function log(value) { const CustomizedRange = React.createClass({ getInitialState: function() { return { + lowerBound: 20, + upperBound: 40, value: [20, 40], }; }, + onLowerBoundChange: function(e) { + this.setState({ lowerBound: +e.target.value }); + }, + onUpperBoundChange: function(e) { + this.setState({ upperBound: +e.target.value }); + }, onSliderChange: function(value) { log(value); this.setState({ value: value, }); }, + handleApply: function() { + const { lowerBound, upperBound } = this.state; + this.setState({ value: [lowerBound, upperBound]}); + }, render: function() { - return ; + return ( +
+ + +
+ + +
+ +

+ +
+ ); }, });