Added initial user documentation for Nested GridFields.

This commit is contained in:
Niklas Forsdahl 2024-04-15 11:02:31 +03:00
parent 19a7cffa88
commit bcc4ea14bb

View File

@ -152,3 +152,17 @@ $paginator->setItemsPerPage(500);
The first shown record will be maintained across page size changes, and the number of pages and current page will be
recalculated on each request, based on the current first shown record and page size.
Nested GridFields
-----------------
The `GridFieldNestedForm` component allows you to nest GridFields in the UI. It can be used with `DataObject` subclasses
with the `Hierarchy` extension, or by specifying the relation used for nesting.
```php
// Basic usage, defaults to the Children-method for Hierarchy objects.
$grid->getConfig()->addComponent(GridFieldNestedForm::create());
// Usage with custom relation
$grid->getConfig()->addComponent(GridFieldNestedForm::create()->setRelationName('MyRelation'));
```