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

114
Views
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 answers
Answer question

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