This module provides a new GridField
component that allows to add rows
to a grid only after setting a relation.
This is quite similar to what already done by stock
GridFieldAddExistingAutocompleter
but with a few important
differences:
- the relation is set by leveraging a standard
DropdownField
; - any relation can be handled (check
setTargetField()
); - the same item can be added more than once (check
setUnique()
).
This can be useful in contexts where GridFieldAddExistingAutocompleter
cannot be used, e.g. setting an has-one relation or linking the same
item more than once in many-many relations.
composer require entidi/silverstripe-gridfieldaddfromlist