Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- favoriteItem(rowKey, rowMap) {
- const { dataSource } = this.state;
- const prevIndex = dataSource.findIndex(item => item.id == rowKey);
- let newDataSource;
- this.state.favoriteModal.setModalVisible(true, !dataSource[prevIndex].favorite);
- dataSource[prevIndex].favorite = !dataSource[prevIndex].favorite;
- newDataSource = dataSource;
- this.setState({
- dataSource: newDataSource
- });
- rowMap[rowKey].closeRow();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement