selvi jp

selvi jp

  • NA
  • 323
  • 78.9k

multi select dropdown selected value in react native

Nov 15 2021 10:52 AM

hI,

I Can add the dropdown.but i want to edit the dropdown also.display the selected dropdown like this.

const _renderItem = item => {
    const postimage = item.imagepath;
    const feedpostimage = { uri: postimage };
    return (
    <View style={styles.item}>
       <Image style={styles.icon} source={feedpostimage}/>
        <Text style={styles.textItem}>{item.item}</Text>
        <Image style={styles.icon} source={require('../components/assests/tick.png')} />
    </View>
    );
};

<MultiSelect
    activeColor={"#a6a6a6"}
    containerStyle={{bottom:62}}
    style={styles.dropdown2}
    data={user}
    labelField="item"
    valueField="id"
    placeholder="Select Pals"
    search
    placeholderStyle={{color:'#fff'}}
    searchPlaceholder="Search"
    value={selected}
    iconColor={'#fff'}
    selectedTextStyle={{color:"#fff"}}
    selectedStyle={{borderColor: "#fff", marginLeft:37,marginRight:-25}}
    onChange={item => {
    setSelected(item);
        console.log('selected', item.toString());
    }}
    renderItem={item => _renderItem(item)}
/>

 


Answers (1)