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

131
Vistas
Call react function from jQuery data table

I am using the jQuery data table in a react application. I want to call a react function from the data table. In the data table, I am using the render function to create a custom column with edit and delete buttons. So when clicking on the button I want to show a bootstrap modal. Below is the code for the render

{
                    "targets": 4,
                    "data": "",
                    "render": function (data, type, row, meta) {
                        return `
                        <div><button type="" class=" mr-3"><img src="images/table-edit-icon.svg" alt=""></button></div>
                        <div><button type="" class="" onClick={e => { setDeleteShow(true); }}><img src="images/table-delete-icon.svg" alt=""></button></div>
                        `;
                    }
                }

Here setDeleteShow is a function in react for showing the modal. It is not working. It is displaying the function name on UI. How can I call this function?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I was able to call the react function using below code.

createdCell: (td, cellData, rowData, row, col) => {
                        ReactDOM.render(
                            <div class=" d-flex">
                            <div><button type="" class=" mr-3"><img src="images/table-edit-icon.svg" alt=""/></button></div>
                        <div><button type="" class="" onClick={() => setDeleteShow(true)}><img src="images/table-delete-icon.svg" alt=""/></button></div>
                        </div>, td)
                    }
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