Skip to content

Commit

Permalink
Allowed setting of column class
Browse files Browse the repository at this point in the history
  • Loading branch information
Iliain authored Aug 4, 2022
1 parent 459b18d commit 7ae57db
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/FormFields/EditableColumnStartField.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,15 @@ class EditableColumnStartField extends EditableFormField
public function getCMSFields()
{
$fields = parent::getCMSFields();
$fields->removeByName(['MergeField', 'Default', 'Validation', 'DisplayRules']);
$fields->removeByName(['MergeField', 'Default', 'Validation', 'DisplayRules', 'RightTitle']);

$titleField = $fields->fieldByName('Root.Main.Title');
$titleField->setTitle('Column class')->setDescription('Set the primary class used to manage the column width. E.g. col-md-6');

$nameField = $fields->fieldByName('Root.Main.Name');
$fields->removeByName('Name');
$fields->insertAfter('ExtraClass', $nameField);

return $fields;
}

Expand All @@ -48,6 +56,13 @@ public function getInlineClassnameField($column, $fieldClasses)
return LabelField::create($column, $this->CMSTitle);
}

public function getInlineTitleField($column)
{
return TextField::create($column, false)
->setAttribute('placeholder', 'Column Class')
->setAttribute('data-placeholder', 'Column Class');
}

public function showInReports()
{
return false;
Expand Down

0 comments on commit 7ae57db

Please sign in to comment.