2
我通過POST請求發送一些數據到數據庫中,我有我的應用程序複選框,我需要用state
在這種情況下如何處理複選框?
我使用this library這是混淆了我一點來處理。
在這裏,我有我的渲染方法
<Checkbox value="Active" ref="Active" defaultChecked={true} onCheck={this._isChecked} />
和功能複選框來處理它
_isChecked =() => {
console.log('Checked: ');
}
我需要它是checked = true
默認。
現在,在這裏我有我使用,以便將數據發送到post
要求
_addDealer =() => {
CreateDealersActions.createDealer({
DealerName : this.refs.DealerName.getValue(),
CardId : this.refs.CardId.getValue(),
NickName : this.refs.NickName.getValue(),
Picture : 'http://lorempixel.com/150/150/',
Active : // HERE I NEED TO SET THE VALUE OF THE CHECKBOX
LegalId : this.refs.LegalId.getValue(),
TypeId : this.refs.TypeId.getValue(),
});
}
中只看該功能的Active : // HERE I NEED TO SET THE VALUE OF THE CHECKBOX
部分功能,還有就是我需要把價值複選框。
那麼,我應該知道爲了發送正確的數據在密鑰Active
,因爲我使用這個庫,我需要把state
?或者還有其他方法嗎?