根据API而不是键的ID选择表行

发布于 2025-01-24 08:58:13 字数 1608 浏览 2 评论 0原文

我是ANTD的新手,我被困在项目的一个地方。我想根据API的ID选择行的复选框,并且当我选择一个复选框时,API不是如何求解它的关键,它是ANTD表中的所有复选框。

 <Table
                        rowSelection={{
                            selectedRowKeys:list.map(item => item.key ),
                            type: selectionType,
                            ...rowSelection,
                            onSelect: (record) => {
                                slctdRws.push(record);
                                Setselectrow(slctdRws);




                            },
   this is one object of many from list  that I am getting from an API
 {
    "PatientName": "RONALDO Christiano",
    "NHI": "GHE9671",
    "DOB": "26-Jan-1992",
    "GenderCode": "M",
    "TxSite": "CMDHB",
    "TxLocation": "Ward-10C",
    "MedicationName": "foliNIc acid (15 mg/m<sup>2</sup>) 30 mg/m<sup>2 IV",
    "TreatmentDayMedicationID": "GcBYv2QSZ4T5/UdjgSXGqw==",
    "TxDay": "Day 4",
    "TreatmentDaysID": "VywrpIeblwxCR2zKASMLlQ==",
    "DoseDirection": null,
    "RequestStatusId": null,
    "Qty": "3",
    "RxStatus": "1",
    "ValidatedBy": "Naveed",
    "ClinicalDecision": false,
    "BookedDate": "2022-04-26T07:45:11.483",
    "DateRequired": "2022-04-26T07:45:11.483",
    "AccuracyCheck": false,
    "ReleasedAt": "2022-04-26T07:45:11.483",
    "IsOnStudy": false,
    "IsCTM": false,
    "IsCom": false,
    "LDO": true,
    "IsApproved": true,
    "IsQueried": false,
    "Dose": "30 mg/m<sup>2",
    "DoseUnit": "mg/m<sup>2</sup>",
    "Diluent": null,
    "Route": null,

}

I'm new to antd and I'm stuck at one place in my project. I want to select the checkboxes of rows by based on the id from an api and the api has not the key how to solve it when i select one check box it is selectin all checkboxes in antd table.

 <Table
                        rowSelection={{
                            selectedRowKeys:list.map(item => item.key ),
                            type: selectionType,
                            ...rowSelection,
                            onSelect: (record) => {
                                slctdRws.push(record);
                                Setselectrow(slctdRws);




                            },
   this is one object of many from list  that I am getting from an API
 {
    "PatientName": "RONALDO Christiano",
    "NHI": "GHE9671",
    "DOB": "26-Jan-1992",
    "GenderCode": "M",
    "TxSite": "CMDHB",
    "TxLocation": "Ward-10C",
    "MedicationName": "foliNIc acid (15 mg/m<sup>2</sup>) 30 mg/m<sup>2 IV",
    "TreatmentDayMedicationID": "GcBYv2QSZ4T5/UdjgSXGqw==",
    "TxDay": "Day 4",
    "TreatmentDaysID": "VywrpIeblwxCR2zKASMLlQ==",
    "DoseDirection": null,
    "RequestStatusId": null,
    "Qty": "3",
    "RxStatus": "1",
    "ValidatedBy": "Naveed",
    "ClinicalDecision": false,
    "BookedDate": "2022-04-26T07:45:11.483",
    "DateRequired": "2022-04-26T07:45:11.483",
    "AccuracyCheck": false,
    "ReleasedAt": "2022-04-26T07:45:11.483",
    "IsOnStudy": false,
    "IsCTM": false,
    "IsCom": false,
    "LDO": true,
    "IsApproved": true,
    "IsQueried": false,
    "Dose": "30 mg/m<sup>2",
    "DoseUnit": "mg/m<sup>2</sup>",
    "Diluent": null,
    "Route": null,

}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文