From 7ae57db78c51444d086236a9886ede16aa0425a1 Mon Sep 17 00:00:00 2001 From: Iliain Date: Thu, 4 Aug 2022 15:41:54 +1000 Subject: [PATCH] Allowed setting of column class --- src/FormFields/EditableColumnStartField.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/FormFields/EditableColumnStartField.php b/src/FormFields/EditableColumnStartField.php index 2f7b294..cc348e9 100644 --- a/src/FormFields/EditableColumnStartField.php +++ b/src/FormFields/EditableColumnStartField.php @@ -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; } @@ -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;