Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

154
Vistas
Accessing nested json in ExpandRow of bootstrap table react component

I have a bootsrap table react component and I will like to add the nested json record as a table when each row in the bootstrap table, the row should expand and show the nested json has a table. However, I can not access the nested json in the expand row function.

My Goal: Presently I have a table showing the data of the outer json in a table. However, I want the elements in the the nested json summary to be represented in a table when each row is clicked.

    const userList = [
      { id: 1, firstName: "james", lastName: "smith", age: 20,summary:{city:'lag', min:12} },
      { id: 2, firstName: "alex", lastName: "green", age: 20 , summary:{city:'lao', min:121}},
      { id: 3, firstName: "may", lastName: "jones", age: 18, summary:{city:'dag', min:112} }
    ];
    
columns=[
{text:'id',dataField:id},
{text:'firstName',dataField:id firstName},
{text:'lastName',dataField: lastName}
]
    
    const expandRow = {
      renderer: row => (
        <BoostrapTable data={userList} columns={row.columns.summary}/>
      )
    };
    
    <BoostrapTable data={userList} columns={columns} keyField="id expandRow={ExpandRow}/>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are using the wrong variable, it's not rows, but row:

const expandRow = {
  renderer: row => (
    <BoostrapTable data={[row.summary]} columns={{text:'city',dataField:'city'},
{text:'min',dataField:'min'}}/>
  )
};
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda