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

224
Visualizações
React Modal on deletion of a row in React-Bootstrap-Table-next

I have been trying to implement a modal that will pop up to confirm deletion before a record is deleted in my bootstrap table. I have tried different methods but to no avail. Is there a way it can be done, I have tried creating a modal and then calling the modal in my actions button, but the delete function will have no effect outside the scope of the formatter. If bootstrap also has its own in built modal which will be easier to use, I wouldn't mind also.

useState and useEffect

 const [data, setData] = useState([]);

 useEffect(() => {
 getData();
 }, []);

     const getData = () => {
    axios(apiUrl).then(res => {
   setData(res.data);
   });
   };

dataTable const and functions

 const columns = [

  {
  dataField: 'name',
  text: 'Name',
  sort: true,
  filter: textFilter(),
  headerStyle: { backgroundColor: 'red', color: 'white' },
  },
  {
  dataField: 'databasePKey',
  text: 'Actions',
  headerStyle: { backgroundColor: 'red', color: 'white' },
  formatter: (cellContent, row) => {
    return (
      <>
        <div className="btn-group flex-btn-group-container">
        
          <Button color="body" size="sm" onClick={() =>handleDelete(row.id)}>
            <FontAwesomeIcon icon="trash" /> <span className="d-none d-md-inline"></span>
          </Button>
        </div>
      </>
     );
     },
     },
 

return jsx containing the bootstrap table

 <BootstrapTable
    keyField="id"
    data={data}
    columns={columns}
    striped
    hover
    condensed
    pagination={paginationFactory()}
    cellEdit={cellEdit}
    filter={filterFactory()}
    noDataIndication="Table is Empty"
    
  />
about 4 years ago · Juan Pablo Isaza
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