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

163
Views
Cómo enviar columnas dinámicas y datos de fila a la tabla antd

ingrese la descripción de la imagen aquí

El siguiente código no acepta una matriz de filas y columnas

Aquí hay un ejemplo de antd:

 const data = []; for (let i = 0; i < 4; i++) { data.push({ key: i, name: `Edward King ${i}`, age: 32 // address: `London, Park Lane no. ${i}` }); } Tried same logic in below: // columns :datacloumns1 // rows :rowdata const data = []; for (let i = 0; i < 4; i++) { for (var j = 0; j < reportDataRows?.length; j++){ data.push({ datacloumns1[i]:rowdata[i] // here i am binding row to the exact column but this is not accepting }); } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Gracias por tus sugerencias.

Aquí está la solución: cambié mi resultado al formato de title e dataIndex de datos, así que me di cuenta de que la tabla dataIndex solo acepta el formato de title e índice de datos.

 let datacloumns = reportDataRows && Object.keys(reportDataRows[0])?.map((key) => ( <span >{cloumns.push({ title: key, dataIndex: key, //defaultSortOrder: 'descend', sorter: true })} </span>)) < Table rowClassName = {(record, index) => index % 2 === 0 ? 'table-row-light' : 'table-row-dark'} size = { 'default'} columns = { cloumns } bordered = { true} sortDirections = { ['ascend', 'descend'] } loading = { reportDataRows === undefined ? true : false} pagination = {{ pageSize: 10 }} dataSource = { reportDataRows === undefined ? [] : reportDataRows} />
about 4 years ago · Juan Pablo Isaza 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!