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

117
Vistas
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 Respuestas
Responde la pregunta

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