react-native-expandable-section-flatlist
react-native-expandable-section-flatlist copied to clipboard
How to close first item when i open second item in Exapandable flatlist?
@shivaraj-profecia The method setSectionState
can be manually set to turn off the group, you can call in the group header click on the headerOnPress to invoke this method to achieve the requirements
I'm sorry to see issue now.
i tried it like this but not working
by default openCheck is false
setSectionState = (i, s) =>{console.log("index "+i+" state "+s); s ? this.setState({ openCheck: true }): this.setState({ openCheck: false}) };
<ExpanableList
style={{marginTop: 60,}}
dataSource={this.state.listDataSource}
headerKey="category"
memberKey="food_items"
renderRow={this._renderRow}
renderSectionHeaderX={this._renderSection}
openOptions={[this.state.ind,]}
headerOnPress= {this.setSectionState}
isOpen={this.state.openCheck}
/>
@cuiyueshuai please suggest how to do it