React-native-multiple-select获取提交的项目

时间:2019-10-01 11:54:01

标签: react-native drop-down-menu picker multiple-select

我正在使用react-native-multiple-select及其工作方式,但是,我想做的是之后提交所有选择的项目,而不是在我正在选择。

<MultiSelect
      hideTags
      items={this.filter_pref}
      uniqueKey="id"
      ref={(component) => { this.multiSelect = component }}
      onSelectedItemsChange={this.onSelectedItemsChange}
      selectedItems={selectedItems}
      selectText="Zgjedh "
      searchInputPlaceholderText="Kerko filterat..."
      // onChangeInput={(text) => console.log(text)}
      altFontFamily="ProximaNova-Light"
      tagRemoveIconColor="#CCC"
      tagBorderColor="#CCC"
      tagTextColor="#CCC"
      selectedItemTextColor="#CCC"
      selectedItemIconColor="#CCC"
      itemTextColor="#000"
      displayKey="name"
      searchInputStyle={{ color: '#CCC' }}
      submitButtonColor="#CCC"
      submitButtonText="Zgjedh"
      />

还有我设置值的函数:

 onSelectedItemsChange = selectedItems => {

        this.setState({ selectedItems });
}

0 个答案:

没有答案