Skip to content

FieldGuesser support for DataTable / Introspecter #618

Closed
@rvanlaak

Description

@rvanlaak

Description
The new DataGrid component is a major improvement over the Datatable.

marmelab/react-admin#10597

Let's make FieldGuesser and related components are compatible.

Example

The component does not use introspection of direct child elements anymore, so that makes rendering and supporting elements like buttons in the table way more flexible.

--- a/pwa/components/admin/domain/Foo.tsx	
+++ b/pwa/components/admin/domain/Foo.tsx
@@ -8,7 +8,7 @@
   ShowGuesser
 } from "@api-platform/admin";
 import {
-  Datagrid,
+  DataTable,
   DateField,
   EditButton,
   ReferenceManyField,
@@ -146,10 +146,12 @@
       </TabbedShowLayout.Tab>
       <TabbedShowLayout.Tab label="foo">
         <ReferenceManyField reference="foo" target="bar">
-          <Datagrid>
-            <TextField source="name"/>
-            <EditButton/>
-          </Datagrid>
+          <DataTable>
+            <FieldGuesser source="name" />
+            <DataTable.Col>
+              <EditButton/>
+            </DataTable.Col>
+          </DataTable>
         </ReferenceManyField>
       </TabbedShowLayout.Tab>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions