Skip to content

Commit

Permalink
Merge pull request #26 from thepearson/master
Browse files Browse the repository at this point in the history
Added ability to provide a custom gridfield config.
  • Loading branch information
wilr committed Nov 30, 2018
2 parents 20ea0a2 + 76474ad commit 90f6486
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/HasOneButtonField.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class HasOneButtonField extends GridField
* @param string|null $fieldName
* @param string|null $title
*/
public function __construct(DataObject $parent, $relationName, $fieldName = null, $title = null)
public function __construct(DataObject $parent, $relationName, $fieldName = null, $title = null, GridFieldConfig $customConfig = null)
{
$record = $parent->{$relationName}();
$this->setRecord($record);
Expand All @@ -70,7 +70,7 @@ public function __construct(DataObject $parent, $relationName, $fieldName = null
// Get columns to display inline
$this->addExtraClass("d-flex align-items-start");

parent::__construct($fieldName ?: $relationName, $title, $list, $config);
parent::__construct($fieldName ?: $relationName, $title, $list, ($customConfig) ?: $config);
$this->setModelClass($record->ClassName);
}

Expand Down

0 comments on commit 90f6486

Please sign in to comment.