react-native-modal-dropdown icon indicating copy to clipboard operation
react-native-modal-dropdown copied to clipboard

RenderRow with image and Text

Open KarthikBaleneni opened this issue 6 years ago • 0 comments

Hi,

I'm wondering if there is a possibility to display both image and text in row by allowing arrays with key value pair index for the following dropdown.


<ModalDropdown enableEmptySections={true} dropdownStyle={styles.dropdown_2_dropdown} renderRow={this.displayRow.bind(this)} textStyle={styles.dropdown_2_text} style={styles.dropdown} defaultValue={i18n.t('selcode')} onSelect={(idx, value) => this._selectedCountry(idx, value)} options={this.state.stCountryList} />

Array like this

options=[{img:'../.png,value:'opotion1},{img:'../.png,value:'option2}]

so that

RenderRow function render will be like

 displayRow = (data) => {
        return (
            <TouchableHighlight>
                <Img  source='require( {`${data.img}`})/>
                <Text style={styles.dropdown_label}>{`${data.value}`}</Text>
            </TouchableHighlight>
        )
    }

KarthikBaleneni avatar Jul 04 '18 06:07 KarthikBaleneni