Add a tab with 2 gridfields, one after the other

This commit is contained in:
Luke Edwards 2018-04-04 14:35:25 +12:00
parent fe4aa6e623
commit 9909f97f81

View File

@ -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;
}
}