根据API而不是键的ID选择表行
我是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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论