dohooo / react-native-reanimated-table

📊 A React Native table component using react-native-reanimated and react-native-gesture-handler.
MIT License
148 stars 4 forks source link

Row click #20

Open TopDev114 opened 1 month ago

TopDev114 commented 1 month ago

Can we add row click event?

awakanto commented 1 month ago

I support this. Currently what is your work around? I am stuck in this.

awakanto commented 1 month ago

I figured out how to properly add a row click event on the Rows property. Hope this may help someone stuck with how to make the entire row clickable and not just the cells.

I use the TableWrapper on a flatlist like this: At the top of the project: import { TableWrapper, Rows} from "react-native-reanimated-table";

then for the flatlist, in the render section I use it like this:

` <FlatList data={filteredCustomersList} ListHeaderComponent={ <SearchBar lightTheme clearIcon searchIcon autoFocus={true} onChangeText={this.handleCustomerSearch} value={searchText} placeholder="Search here..." /> } ListFooterComponent={this.renderFooter()} refreshing={this.state.refreshing} onRefresh={this.handleRefresh} keyExtractor={(item) => item.ID} renderItem={({ item }) => (

{ this.handleCustomerClicked(item); }} > {item.CUSTOMERSNAME} , ], ]} widthArr={widthArr} height={50} style={styles.tableTextMargin} textStyle={styles.tableText} /> )} />`