I'm new in react native listview with checkbox and in my case I want to select multiple items and here's what I've got for now
this.state = {
checkedBoxCheck: undefined,
}
onCheckBoxPress(id, name, itemid, desc) {
this.setState({
checkedBoxCheck: id,
name: name,
itemid: itemid,
desc: desc
})
}
renderRow(rowData) {
return (
<View style={styles.modalcontainerlist}>
...
<View style=>
<CheckBox style={styles.checkboxed}
checked={rowData.id === this.state.checkedBoxCheck}
onPress={() => this.onCheckBoxPress(rowData.id, rowData.item_name, rowData.item_id, rowData.description)}
/>
</View>
</View>
);
}
Aucun commentaire:
Enregistrer un commentaire