Merge pull request #48 from open-sausages/pulls/get-off-my-gridfield

Add a tab with 2 gridfields, one after the other
This commit is contained in:
Aaron Carlino 2018-04-09 16:59:12 +12:00 committed by GitHub
commit 87b77e5551
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 0 deletions

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