UserRow.jsx

82 lines | 2.065 kB Blame History Raw Download


//class UserRow extends React.Component {

//    constructor(props) {
//        super(props);
//        Log('UserRow start ' + this.props.ID);

//        this.state = { ID: this.props.ID, Data: this.props.data, ShoSelect: this.props.ShoSelect };


//        this.OnNameChange = this.OnNameChange.bind(this);
//    }

//    componentWillReceiveProps(nextProps) {
//        this.props = nextProps;

//        if (this.refs.Select != undefined)
//            this.refs.Select.checked = false;

//        this.setState({
//            ID: this.props.ID,
//            Data: this.props.data,
//            ShoSelect: this.props.ShoSelect
//        });
//    }


//    OnChange() {

//    }

//    OnNameChange() {
//        let elem = state.Data;
//        elem.Name = this.refs.Name.value;
//        OnChange();
//    }

//    OnPasswordChange() {
//        let elem = state.Data;
//        elem.Password = this.refs.Password.value;
//        OnChange();
//    }



//    render() {
//        let state = this.state;
//        let elem = state.Data;

//        return (
//            <tr>
//                <td>{elem.ID}</td>
//                {state.ShoSelect
//                    ?
//                    <td>
//                        <input ref="Select" type="checkbox" />
//                    </td>
//                    : ""
//                }

//                <td><input ref="Name" onChange={this.OnNameChange} value={elem.Name}></input></td>
//                <td><input ref="Password" onChange={this.OnPasswordChange} value={elem.Password}></input></td>
//                <td><input ref="Active" type="checkbox" value={elem.Active}></input></td>

//                <td>
//                    {
//                        elem.Groups.map(function (group) {
//                            if (group.EnterInGroup)
//                                return <p>{group.Name}</p>
//                        })
//                    }
//                    <button>Изменить</button>
//                </td>

//                <td><button>Delete</button></td>

//            </tr>
//        );

//    }
//}