如何从RadioForm设置值和保存值数组-反馈表

时间:2018-12-14 08:42:37

标签: android react-native webstorm

我从一个数组中填充了这个RadioForm数组。填充radio_props效果很好。

constructor() {
    super();

    this.state = {
        loading: true,
        radio_props1:[],
        value:'',
        valueIndex:0,
    }


}

但是我遇到的问题是如何

  • 找到一种提交这些RadioForm数组的方法(也许将选择状态转换为json)
  • 使每行/索引RadioForm处于选中状态,并在单击时取消选择

现在,当我单击每个单选按钮时,什么也没发生。

   <RadioForm
    radio_props={this.state.radio_props1}
    initial={this.state.value}
    formHorizontal={true}
    buttonSize={10}
    buttonOuterSize={20}
    buttonOuterColor={this.state.valueIndex === index ? '#585858' : '#000'}
    borderWidth={1}
    animation={true}
    isSelected = {(this.state.valueIndex===index?true:false)}
    index={index}
    buttonInnerColor={'#80146D'}
    onPress={(value,index) => {

        this.setState({
            value: value,
            valueIndex: index
        })
      }}
  >

</RadioForm>

表格带的图像 enter image description here

0 个答案:

没有答案