react-backbone.js
function(type, attributes, isCheckable, classAttributes) {
        return React.createClass(_.extend({
            mixins: ['modelAware'],
            render: function() {
                var props = {};
                var defaultValue = getModelValue(this);
                if (isCheckable) {
                    props.defaultChecked = defaultValue;
                } else {
                    props.defaultValue = defaultValue;
                }
                return React.DOM[type](_.extend(props, attributes, this.props,
                    {onChange: twoWayBinding(this)}), this.props.children);
            },
            getValue: function() {
                if (this.isMounted()) {
                    if (isCheckable) {
                        var el = this.getDOMNode();
                        return el.checked ? true : false;
                    } else {
                        return getElementValue(this);
                    }
                }
            },
            getDOMValue: function() {
                if (this.isMounted()) {
                    return getElementValue(this);
                }
            }
        }, classAttributes));
    }
function(type, attributes, isCheckable, classAttributes) {
        return React.createClass(_.extend({
            mixins: ['modelAware'],
            render: function() {
                var props = {};
                var defaultValue = getModelValue(this);
                if (isCheckable) {
                    props.defaultChecked = defaultValue;
                } else {
                    props.defaultValue = defaultValue;
                }
                return React.DOM[type](_.extend(props, attributes, this.props,
                    {onChange: twoWayBinding(this)}), this.props.children);
            },
            getValue: function() {
                if (this.isMounted()) {
                    if (isCheckable) {
                        var el = this.getDOMNode();
                        return el.checked ? true : false;
                    } else {
                        return getElementValue(this);
                    }
                }
            },
            getDOMValue: function() {
                if (this.isMounted()) {
                    return getElementValue(this);
                }
            }
        }, classAttributes));
    }
function ( type , attributes , isCheckable , classAttributes ) { return React . createClass ( _ . extend ( { mixins : [ 'modelAware' ] , render : function ( ) { var props = { } ; var defaultValue = getModelValue ( this ) ; if ( isCheckable ) { props . defaultChecked = defaultValue ; } else { props . defaultValue = defaultValue ; } return React . DOM [ type ] ( _ . extend ( props , attributes , this . props , { onChange : twoWayBinding ( this ) } ) , this . props . children ) ; } , getValue : function ( ) { if ( this . isMounted ( ) ) { if ( isCheckable ) { var el = this . getDOMNode ( ) ; return el . checked ? true : false ; } else { return getElementValue ( this ) ; } } } , getDOMValue : function ( ) { if ( this . isMounted ( ) ) { return getElementValue ( this ) ; } } } , classAttributes ) ) ; }
Standard input components that implement react-backbone model awareness
Standard input components that implement react - backbone model awareness