Skip to content

Commit

Permalink
Merge pull request #12 from thewebmen/Dennisprins93-patch-2
Browse files Browse the repository at this point in the history
Update ArticlesPage.php
  • Loading branch information
Dennis Prins authored Dec 21, 2021
2 parents 22935a2 + 7ebcfb7 commit ab2256b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Pages/ArticlesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldAddExistingAutocompleter;
use SilverStripe\Forms\GridField\GridFieldAddNewButton;
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor;
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor;
use SilverStripe\Forms\GridField\GridFieldEditButton;
use SilverStripe\Forms\NumericField;
use SilverStripe\Lumberjack\Forms\GridFieldConfig_Lumberjack;
use SilverStripe\Lumberjack\Forms\GridFieldSiteTreeAddNewButton;
use SilverStripe\ORM\DataList;
use SilverStripe\ORM\HasManyList;
use SilverStripe\ORM\ManyManyList;
use SilverStripe\Versioned\GridFieldArchiveAction;
use Symbiote\GridFieldExtensions\GridFieldOrderableRows;
use TheWebmen\Articles\Controllers\ArticlesPageController;
use TheWebmen\Articles\Models\Author;
Expand Down Expand Up @@ -190,6 +193,9 @@ private function getGridConfig(string $sortColumn): GridFieldConfig_RelationEdit
{
$gridfieldConfig = GridFieldConfig_RelationEditor::create();
$gridfieldConfig->addComponent(new GridFieldOrderableRows($sortColumn));
$gridfieldConfig->removeComponentsByType(GridFieldAddNewButton::class);
$gridfieldConfig->removeComponentsByType(GridFieldArchiveAction::class);
$gridfieldConfig->removeComponentsByType(GridFieldEditButton::class);

/** @var GridFieldAddExistingAutocompleter $autocompleter */
$autocompleter = $gridfieldConfig->getComponentByType(GridFieldAddExistingAutocompleter::class);
Expand Down

0 comments on commit ab2256b

Please sign in to comment.