FIX Show correct class names in field editor GridField dropdowns

This commit is contained in:
Robbie Averill 2017-08-23 10:04:42 +12:00
parent d90d54186e
commit 100b84dc08
2 changed files with 13 additions and 9 deletions

View File

@ -76,16 +76,20 @@ class UserFormFieldEditorExtension extends DataExtension
$editableColumns = new GridFieldEditableColumns(); $editableColumns = new GridFieldEditableColumns();
$fieldClasses = singleton(EditableFormField::class)->getEditableFieldClasses(); $fieldClasses = singleton(EditableFormField::class)->getEditableFieldClasses();
$editableColumns->setDisplayFields([ $editableColumns->setDisplayFields([
'ClassName' => function ($record, $column, $grid) use ($fieldClasses) { 'ClassName' => [
if ($record instanceof EditableFormField) { 'callback' => function ($record, $column, $grid) use ($fieldClasses) {
return $record->getInlineClassnameField($column, $fieldClasses); if ($record instanceof EditableFormField) {
return $record->getInlineClassnameField($column, $fieldClasses);
}
} }
}, ],
'Title' => function ($record, $column, $grid) { 'Title' => [
if ($record instanceof EditableFormField) { 'callback' => function ($record, $column, $grid) {
return $record->getInlineTitleField($column); if ($record instanceof EditableFormField) {
return $record->getInlineTitleField($column);
}
} }
} ]
]); ]);
$config = GridFieldConfig::create() $config = GridFieldConfig::create()

View File

@ -47,7 +47,7 @@ class UserDefinedForm extends Page
/** /**
* @var string * @var string
*/ */
private static $icon = 'userforms/images/sitetree_icon.png'; private static $icon = 'userforms/client/dist/images/sitetree_icon.png';
/** /**
* @var string * @var string