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

130
Visualizações
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 Respostas
Responde à pergunta

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