From 365998f4453508cbb14d2e217a2003ae4a92ba7b Mon Sep 17 00:00:00 2001 From: Guy Sartorelli Date: Tue, 29 Jun 2021 11:23:58 +1200 Subject: [PATCH] ENH Add extension point for modifying readonly GridFields. Developers may want to amend a gridfield (either by modifying its components or amending the list) after it has been transformed to be readonly. One such modification may be replacing the GridFieldViewButton with something else - because components are instantiated with the "new" keyword this would be the only way to do that. --- src/Forms/GridField/GridField.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Forms/GridField/GridField.php b/src/Forms/GridField/GridField.php index c3b0a2635..a89104026 100644 --- a/src/Forms/GridField/GridField.php +++ b/src/Forms/GridField/GridField.php @@ -272,6 +272,8 @@ class GridField extends FormField $copyConfig->addComponent(new GridFieldViewButton); } + $copy->extend('afterPerformReadonlyTransformation', $this); + return $copy; }