Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

417
Visualizações
Hidden columns in Material-Table causing crash

I have three columns in my Material-Table which provide useful data but are not essential. I want these columns hidden by default when the page is loaded, but give the user the option to un-hide them. I have the columnsButton option set which allows me to manually select which columns I want hidden. By default, no columns are hidden.

I have tried using hidden: true and hiddenByColumnsButton: true. hidden just hides the column and the option to show it does not appear in the columnsButton list. hiddenbyColumnsButton does not hide the column and no effect the functionality of the list. Using both of them at the same time in the same column results in the app crashing: Uncaught TypeError: Cannot read properties of undefined

This is my table and a two of my columns. For the purpose of this question, I want to have Title hidden by default with the option to display it in the columnsButton list.

    const columns = [
        {
            title: <Typography className={classes.colHeader}>Intake ID</Typography>,
            field: "IntakeID",
            cellStyle: { minWidth: 118, maxWidth: 118 },
            // hidden: true,
        },
        {
            title: <Typography className={classes.colHeader}>Title</Typography>,
            field: "Title",
            cellStyle: { minWidth: 280, maxWidth: 280 },
            hidden: true,
            hiddenByColumnsButton: true,
        },
    ];

...
                <MTable
                    title="Table"
                    data={intakes.intakes}
                    columns={columns}
                    options={{
                        columnsButton: true,
                        pageSize: 10,
                        pageSizeOptions: [10, 15, 25, 50, 100],
                        paginationType: "stepped",
                        padding: "small",
                        filtering: true,
                />

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda