Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
Agregar columna de casillas de verificación para cada fila en la tabla

Hola, ¿cómo puedo agregar una nueva columna con casillas de verificación para cada fila en el lado izquierdo de mi columna de id ?

 export default function Display() { const { menus } = JsonData; const data = useMemo( () => [ { Header: "Id", // accessor: "id" accessor: (row) => row.id }, { Header: "Title", accessor: (row) => ({ title: row.title, id: row.id }), Cell: ({ value }) => ( <Link to={{ pathname: `/menu/${value.id}` }}>{value.title}</Link> ) } ], [] ); return ( <Table data={menus} columns={data} withCellBorder withRowBorder withSorting withPagination /> ); }

Aquí está mi códigoSandbox

about 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Simplemente agregue una nueva entrada en la matriz:

 export default function Display() { const { menus } = JsonData; const data = useMemo( () => [ { Header: "Ceckbox", // accessor: "id" accessor: (row) => row.id, Cell: ({ value }) => ( <input type='checkbox' /> ) }, { Header: "Id", // accessor: "id" accessor: (row) => row.id }, { Header: "Title", accessor: (row) => ({ title: row.title, id: row.id }), Cell: ({ value }) => ( <Link to={{ pathname: `/menu/${value.id}` }}>{value.title}</Link> ) } ], [] ); return ( <Table data={menus} columns={data} withCellBorder withRowBorder withSorting withPagination /> ); }
about 4 years ago · Santiago Trujillo Report

0

Puede agregar una nueva columna a sus datos:

 const data = useMemo( () => [ { id: "check", accessor: (row) => row.title, Cell: ({ value }) => <input type="checkbox" value={value} /> }, { Header: "Id", // accessor: "id" accessor: (row) => row.id }, { Header: "Title", // accessor: "title" accessor: (row) => ({ title: row.title, id: row.id }), // accessor: (row) => ( // <Link to={{ pathname: `/menu/${row.id}` }}>{row.title}</Link> // ) // Link the content of my cell. NOT WORKING //Cell: ({ row }) => ( //<Link to={{ pathname: `/menu/${row.id}` }}>{row.title}</Link> //) Cell: ({ value }) => ( <Link to={{ pathname: `/menu/${value.id}` }}>{value.title}</Link> ) } ], [] );

Editar filtros (bifurcado)

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!