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

282
Visualizações
DataGrid en blanco/no muestra datos? Interfaz de usuario de materiales

Por alguna razón, mi tabla DataGrid no muestra nada.

Ejemplo de mis datos y DataGrid que no muestran nada en un nuevo proyecto con el código fuente de abajo

Tuve este problema en mi proyecto anterior y pensé que era algo que hice cuando intentaba aprender todo, así que hice otro proyecto, configuré reactjs y material ui e intenté nuevamente y tuve el mismo problema.

Hice un informe de error en GitHub pero realmente estoy buscando una solución rápida. ¿Alguien tiene alguna idea? Todo en mi proyecto se ha actualizado a la última versión (incluidas las bibliotecas django y mui)

 import React, { useEffect, useState } from "react" import jQuery from 'jquery' import { Container } from '@mui/material'; import { DataGrid, GridRowsProp, GridColDef } from '@mui/x-data-grid' function WatcherOverview() { const columns = [ { field: 'id', headerName: 'ID', width: 90 }, { field: 'firstName', headerName: 'First name', width: 150, editable: true, }, { field: 'lastName', headerName: 'Last name', width: 150, editable: true, }, { field: 'age', headerName: 'Age', type: 'number', width: 110, editable: true, }, { field: 'fullName', headerName: 'Full name', description: 'This column has a value getter and is not sortable.', sortable: false, width: 160, valueGetter: (params) => `${params.row.firstName || ''} ${params.row.lastName || ''}`, }, ]; const rows = [ { id: 1, lastName: 'Snow', firstName: 'Jon', age: 35 }, { id: 2, lastName: 'Lannister', firstName: 'Cersei', age: 42 }, { id: 3, lastName: 'Lannister', firstName: 'Jaime', age: 45 }, { id: 4, lastName: 'Stark', firstName: 'Arya', age: 16 }, { id: 5, lastName: 'Targaryen', firstName: 'Daenerys', age: null }, { id: 6, lastName: 'Melisandre', firstName: null, age: 150 }, { id: 7, lastName: 'Clifford', firstName: 'Ferrara', age: 44 }, { id: 8, lastName: 'Frances', firstName: 'Rossini', age: 36 }, { id: 9, lastName: 'Roxie', firstName: 'Harvey', age: 65 }, ]; return ( <Container> <h1>Single items:</h1> <DataGrid rows={rows} columns={columns} pageSize={5} rowsPerPageOptions={[5]} checkboxSelection disableSelectionOnClick /> </Container> ); } export default WatcherOverview
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Te faltan los accesorios de autoHeight en DataGrid. si desea más control de gránulos sobre la altura. luego verifique headerHeight y rowHeight en https://mui.com/api/data-grid/data-grid/

 <DataGrid ... autoHeight />

Además, si no desea usar autoHeight en DataGrid, debe especificar la altura en el contenedor. https://mui.com/components/data-grid/layout/

 <Container sx={{height: 350}}> ... <DataGrid ... /> </Container>

también puede usar headerHeight y rowHeight para un mayor control de gránulos.

 <Container sx={{height: 350}}> ... <DataGrid ... headerHeight={75} rowHeight={65} /> </Container>
about 4 years ago · Juan Pablo Isaza Relatório
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