Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

179
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!