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

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

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