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

115
Visualizações
Extracting the properties of object

I'm passing the complete object in the value attribute of a radio button and that radio button is present in a data-table itself. I want all the columns data of that particular row in a data-table.

But the problem is some of their td contains some html structure and I only want their text value. So I tried to make a object of all the column (working on jinja template )and passing that object in the radio button itself.

{% set table_data ={'fileName':file_name,'fileType':file_type,'size':size,'createdBy':create_by,'lastModifiedDate':last_modified_date} -%}

<input type="radio" value={{data_table}}>

I got the value in the console

let obj=e.target.value;
  console.log(obj); // "{'fileName': 'This is the file2.png','fileType': 'file','size': '4.5 MB','createdBy': 'Anuj','lastModifiedDate': '23 Apr 2022, 06:00 PM'}"

but when I try to extract each value it is giving undefined in the console. How to solve this issue pls reply

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Looks like you have a stringified object. You'll need to parse it first:

let obj = JSON.parse(e.target.value);

console.log(obj);
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