entidi/silverstripe-gridfieldaddfromlist

Adds rows to GridField from a dropdown list

Installs: 125

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.0.2 2021-06-29 10:17 UTC

This package is auto-updated.

Last update: 2024-03-29 04:45:44 UTC


README

This module provides a new GridField component that allows to add rows to a grid only after setting a relation.

Screenshot of GridFieldAddFromList

This is quite similar to what already done by stock GridFieldAddExistingAutocompleter but with a few important differences:

  1. the relation is set by leveraging a standard DropdownField;
  2. any relation can be handled (check setTargetField());
  3. 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.

Installation

composer require entidi/silverstripe-gridfieldaddfromlist

Other documentation