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

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