react-native-selectablesectionlistview icon indicating copy to clipboard operation
react-native-selectablesectionlistview copied to clipboard

onCellSelect

Open ssomnoremac opened this issue 9 years ago • 1 comments
trafficstars

Is onCellSelect hooked up? If so how is it used? How do you bind the instance of what is selected and shouldn't the cell be a touchable component?

ssomnoremac avatar Jul 12 '16 18:07 ssomnoremac

Ok, it is hooked up. I'm building out an alphabetized version of this where I hope to emulate the Android contacts page so I'm going to add it to the docs there but here is what's needed:

on your touch component (UserCell):

onPress={this.props.onSelect.bind(this)}

I brought the Cell into render of SectionableListView Component in as a Reusable Compoent like this:

const Cell = (props) => {
    <UserCell
      user = { props.item }
      onSelect = {props.onSelect} />
}
...
<SectionabletListView
        ...
        onCellSelect={this.onSelect}

... // outside render()
onSelect() { ...

ssomnoremac avatar Jul 12 '16 19:07 ssomnoremac