import React from "react"; import { List, Datagrid, TextField, EditButton,BooleanField } from 'react-admin'; import { useRecordContext } from "react-admin"; const PostPanel = () => { const record = useRecordContext(); return ( <div dangerouslySetInnerHTML={{ __html: record.name }} /> ); }; export const DatagridAnyList = () => ( <List resource="t_geyao_person"> <Datagrid expand={<PostPanel />} optimized isRowSelectable={ record => record.id > 2 } isRowExpandable={row => row.id} > <TextField source="id" /> <TextField source='name'></TextField> <TextField source='sex'></TextField> <TextField source='salary'></TextField> <BooleanField source='status'></BooleanField> <EditButton /> </Datagrid> </List> );
optimized检查权限的写法