mirror of
https://github.com/a2nt/cms-niceties.git
synced 2024-10-22 11:05:46 +02:00
IMPR: GridField show buttons instead of dropdown
This commit is contained in:
parent
e754b8a724
commit
c29014512d
24
src/Forms/GridField/GridFieldConfig_RecordEditor.php
Normal file
24
src/Forms/GridField/GridFieldConfig_RecordEditor.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace A2nt\CMSNiceties\Forms\GridField;
|
||||
|
||||
use SilverStripe\Forms\GridField\GridField_ActionMenu;
|
||||
use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor as GridFieldGridFieldConfig_RecordEditor;
|
||||
use SilverStripe\Forms\GridField\GridFieldEditButton;
|
||||
|
||||
class GridFieldConfig_RecordEditor extends GridFieldGridFieldConfig_RecordEditor
|
||||
{
|
||||
public function __construct($itemsPerPage = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->removeComponentsByType([
|
||||
GridField_ActionMenu::class,
|
||||
]);
|
||||
|
||||
$btn = $this->getComponentByType(GridFieldEditButton::class);
|
||||
if ($btn) {
|
||||
$btn->removeExtraClass('grid-field__icon-action--hidden-on-hover');
|
||||
}
|
||||
}
|
||||
}
|
24
src/Forms/GridField/GridFieldConfig_RelationEditor.php
Normal file
24
src/Forms/GridField/GridFieldConfig_RelationEditor.php
Normal file
@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace A2nt\CMSNiceties\Forms\GridField;
|
||||
|
||||
use SilverStripe\Forms\GridField\GridField_ActionMenu;
|
||||
use SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor as GridFieldGridFieldConfig_RelationEditor;
|
||||
use SilverStripe\Forms\GridField\GridFieldEditButton;
|
||||
|
||||
class GridFieldConfig_RelationEditor extends GridFieldGridFieldConfig_RelationEditor
|
||||
{
|
||||
public function __construct($itemsPerPage = null, $showPagination = null, $showAdd = null)
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->removeComponentsByType([
|
||||
GridField_ActionMenu::class,
|
||||
]);
|
||||
|
||||
$btn = $this->getComponentByType(GridFieldEditButton::class);
|
||||
if ($btn) {
|
||||
$btn->removeExtraClass('grid-field__icon-action--hidden-on-hover');
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user