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

192
Views
Error al pasar td.parentNode javascript en el método 'onclick'

Estoy trabajando con DataTables ( https://datatables.net/examples/basic_init/zero_configuration.html ) y javascript, en este momento estoy lidiando con el comportamiento de 'editar'. Si hago clic en el ícono de edición, una fila completa debería ser editable.

Ahora, en mi archivo javascript, estoy usando la propiedad 'fnCreatedCell' ( https://legacy.datatables.net/ref#fnCreatedCell ) y pasando un nTd.parentNode como parámetro dentro del ícono de mi botón en 'onclick=enableEditableRow ( ${nTd.parentNode} )', por lo que mi problema aquí es que, por alguna razón, javascript me arroja un error:

Error de sintaxis no detectado: Identificador no esperado

Ni siquiera es útil... IDK cómo pasar exactamente este parámetro.

Aquí está mi código:

 { data: null, title: 'Edit', orderable: false, fnCreatedCell: function (nTd, sData, oData, iRow, iCol) { $(nTd).html(`<button type="button" class="btn btn-outline-secondary" onclick='enableEditableRow(${oData.id}, ${iRow}, ${nTd.parentNode})'> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16"> <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/> <path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/> </svg> </button>`); } }
about 4 years ago · Juan Pablo Isaza
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!