【发布时间】:2021-06-01 23:03:00
【问题描述】:
我正在使用 material-ui 中的 DataGrid 来制作一个表格来显示我的数据。我遇到的问题是我有一个嵌套的数据数组,但是我无法使用 `
key field:
const columns = [
{ field: "Patient.full_name", headerName: "Full name patient", width: 130 },
{ field: "id_number", headerName: "id number", type: "number", width: 130 },];
export default function DataTable(props) {
const { exams } = props;
return (
<div style={{ height: 400, width: "100%" }}>
<DataGrid rows={exams} columns={columns} />
</div>
);`
id_number 有效。但我似乎无法获得显示全名的嵌套值,我也尝试了“全名”、“患者:全名”。是否有可能在字符串字段中获取该值?
【问题讨论】:
标签: arrays reactjs datagrid material-ui