Open kelvindominguez1595 opened 3 years ago
+1 I need this too
there was no response ...
Hi, I'm using like this,
const [tableData, setTableData] = React.useState({ tableHead: ["Hiding Head","Head 1", "Head 2", "Head 3"], tData: comeData, <--- your array data });
const TableCont = (item: any) => {
const element = (data: any, index: any) => {
if(index === 0)
{
return false;
}else if(index === 1){
return (
<TouchableOpacity onPress={() => console.log('data : ',data)} >
<Text style={style.rowTextStyleFirst}>{data}</Text>
</TouchableOpacity>
);
}else{
return <Text style={style.rowTextStyleFirst}>{data}</Text>
}
}
let flexArr=[-1, 3, 1, 1];
return (
<Table borderStyle={style.tableStyle}>
<Row
flexArr={flexArr}
data={tableData.tableHead}
style={style.headStyle}
textStyle={style.headTextStyle}
/>
{comeData.map((rowData: any, index: any) => (
<TableWrapper key={index} style={style.rowStyle}>
{rowData.map((cellData: any, cellIndex: any) => (
<Cell
key={cellIndex}
flex={flexArr[cellIndex]}
textStyle={style.rowTextStyle}
data={element(cellData, cellIndex)}
/>
))}
</TableWrapper>
))}
</Table>
);
};
Maybe it helps
I am trying to hide a cell or the entire column since it will contain a unique identifier that is the ID of a record, could you help me?