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

182
Vistas
How to change the state of attendance?

I have a ant design table with a checkbox in the column "attendance" i want to switch the state of that attendance for example i want to change the state from "absent" to "present" or vice versa, depending if the checkbox is checked or not. But i don't have idea how to do that. I will share my code below:

import { Col, Form, Row, Select, Table, Input } from "antd";

const { Option } = Select;

function AsistenciaDia() {

  const columns = [
    {
      title: "NOMBRE",
      dataIndex: "name",
      align: "center",
    },
    Table.SELECTION_COLUMN,
    {
      title: "ASISTENCIA",
      dataIndex: "asist",
      align: "center",
    },
  ];

  const data = [];
  for (let i = 0; i < 40; i++) {
    data.push({
      key: i,
      name: `nombre  ${i}`,
      asist: 'Absent',
    });
  }

  return (
    <
      <div className="container-asist-dia">
        <Table
          className="asist-dia"
          columns={columns}
          rowSelection={{}}
          dataSource={data}
          pagination={false}
          scroll={{ y: 400 }}
        />
      </div>

    </>
  );
}

export default AsistenciaDia;
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Use the rowSelection prop of Table.
In this you will get selected row object and just update the true/false flag based on your requirement.
If flag value if true than set present otherwise absent.
Link: https://codesandbox.io/s/w43hup

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