material-table icon indicating copy to clipboard operation
material-table copied to clipboard

Hide column

Open ytebboune opened this issue 6 years ago • 5 comments

Hello, is there a way to have a hidden column ? I have an id column that needs to be posted, but I don't want it to be displayed to users. I tried to set column the type: "hidden" but it doesn't work. I also tried to display:none as cellstyle and headerstyle, but the fact is that when we add a row with "plus" it shows the input to fill it. I don't want the user to fill it, I only want datas that I prefilled on my table to have an ID, not the other ones.

How can I hide a column ?

ytebboune avatar Feb 20 '20 16:02 ytebboune

This should work.

    <MaterialTable
      columns={[
        {
          title: 'Provider',
          field: 'provider',
          hidden: true
        }
      ]}
    />

jonasanx avatar Feb 20 '20 19:02 jonasanx

Thanks you :)

ytebboune avatar Feb 24 '20 08:02 ytebboune

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You can reopen it if it required.

stale[bot] avatar Jul 05 '20 20:07 stale[bot]

I am also wondering if there is a way to hide column if my current data does not has the field? (The data is dynamic) Current behavior is it will show an empty column.

Thanks!

flora8984461 avatar May 27 '21 00:05 flora8984461

Did you find any way to do that?

neaRRRRR avatar Sep 22 '22 10:09 neaRRRRR