Skip to content

FieldGuesser support for DataTable / Introspecter #618

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rvanlaak opened this issue May 1, 2025 · 1 comment
Closed

FieldGuesser support for DataTable / Introspecter #618

rvanlaak opened this issue May 1, 2025 · 1 comment

Comments

@rvanlaak
Copy link

rvanlaak commented May 1, 2025

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>
@fzaninotto
Copy link
Contributor

This is already on our roadmap, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants