From 9909f97f812686f928633e2da10faaca74cc3280 Mon Sep 17 00:00:00 2001 From: Luke Edwards Date: Wed, 4 Apr 2018 14:35:25 +1200 Subject: [PATCH] Add a tab with 2 gridfields, one after the other --- code/GridFieldTestPage.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/GridFieldTestPage.php b/code/GridFieldTestPage.php index c94e366..3ec93e5 100644 --- a/code/GridFieldTestPage.php +++ b/code/GridFieldTestPage.php @@ -54,6 +54,18 @@ class GridFieldTestPage extends TestPage $fields->addFieldToTab('Root.ManyMany', $grid); $grids[] = $grid; + $config = new GridFieldConfig_RelationEditor(); + $grid = new GridField('HasManyCompaniesStacked', 'HasManyCompanies', $this->HasManyCompanies(), $config); + $grid->setDescription('Records are owned by the page, so should auto-publish'); + $fields->addFieldToTab('Root.Stacked', $grid); + $grids[] = $grid; + + $config = new GridFieldConfig_RelationEditor(); + $grid = new GridField('ManyManyCompaniesStacked', 'ManyManyCompanies', $this->ManyManyCompanies(), $config); + $grid->setDescription('Records are NOT owned by the page, and need to be individually published'); + $fields->addFieldToTab('Root.Stacked', $grid); + $grids[] = $grid; + return $fields; } }