Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

How to hide a cell or a column. #137

Open
kelvindominguez1595 opened this issue Feb 23, 2021 · 3 comments
Open

How to hide a cell or a column. #137

kelvindominguez1595 opened this issue Feb 23, 2021 · 3 comments

Comments

@kelvindominguez1595
Copy link

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?

@RichMatthews
Copy link

+1 I need this too

@kelvindominguez1595
Copy link
Author

there was no response ...

@mcatal
Copy link

mcatal commented Mar 9, 2022

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants