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

161
Visualizações
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 Respostas
Responde à pergunta

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 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