public function getFieldEditorGrid()
    {
        Requirements::javascript('silverstripe/userforms:client/dist/js/userforms-cms.js');

        $fields = $this->owner->Fields();

        $this->createInitialFormStep(true);

        $editableColumns = new GridFieldEditableColumns();
        $fieldClasses = singleton(EditableFormField::class)->getEditableFieldClasses();
        $editableColumns->setDisplayFields([
            'ClassName' => function ($record, $column, $grid) use ($fieldClasses) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineClassnameField($column, $fieldClasses);
                }
            },
            'Title' => function ($record, $column, $grid) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineTitleField($column);
                }
            }
        ]);

        $config = GridFieldConfig::create()
            ->addComponents(
                $editableColumns,
                new GridFieldButtonRow(),
                (new GridFieldAddClassesButton(EditableTextField::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD', 'Add Field'))
                    ->setButtonClass('btn-primary'),
                (new GridFieldAddClassesButton(EditableFormStep::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_PAGE_BREAK', 'Add Page Break'))
                    ->setButtonClass('btn-secondary'),
                (new GridFieldAddClassesButton([EditableFieldGroup::class, EditableFieldGroupEnd::class]))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD_GROUP', 'Add Field Group'))
                    ->setButtonClass('btn-secondary'),
                $editButton = new GridFieldEditButton(),
                new GridFieldDeleteAction(),
                new GridFieldToolbarHeader(),
                new GridFieldOrderableRows('Sort'),
                new GridFieldDetailForm()
            );

        $editButton->removeExtraClass('grid-field__icon-action--hidden-on-hover');

        $fieldEditor = GridField::create(
            'Fields',
            '',
            $fields,
            $config
        )->addExtraClass('uf-field-editor');

        return $fieldEditor;
    }
public function getFieldEditorGrid()
    {
        Requirements::javascript('silverstripe/userforms:client/dist/js/userforms-cms.js');

        $fields = $this->owner->Fields();

        $this->createInitialFormStep(true);

        $editableColumns = new GridFieldEditableColumns();
        $fieldClasses = singleton(EditableFormField::class)->getEditableFieldClasses();
        $editableColumns->setDisplayFields([
            'ClassName' => function ($record, $column, $grid) use ($fieldClasses) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineClassnameField($column, $fieldClasses);
                }
            },
            'Title' => function ($record, $column, $grid) {
                if ($record instanceof EditableFormField) {
                    return $record->getInlineTitleField($column);
                }
            }
        ]);

        $config = GridFieldConfig::create()
            ->addComponents(
                $editableColumns,
                new GridFieldButtonRow(),
                (new GridFieldAddClassesButton(EditableTextField::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD', 'Add Field'))
                    ->setButtonClass('btn-primary'),
                (new GridFieldAddClassesButton(EditableFormStep::class))
                    ->setButtonName(_t(__CLASS__.'.ADD_PAGE_BREAK', 'Add Page Break'))
                    ->setButtonClass('btn-secondary'),
                (new GridFieldAddClassesButton([EditableFieldGroup::class, EditableFieldGroupEnd::class]))
                    ->setButtonName(_t(__CLASS__.'.ADD_FIELD_GROUP', 'Add Field Group'))
                    ->setButtonClass('btn-secondary'),
                $editButton = new GridFieldEditButton(),
                new GridFieldDeleteAction(),
                new GridFieldToolbarHeader(),
                new GridFieldOrderableRows('Sort'),
                new GridFieldDetailForm()
            );

        $editButton->removeExtraClass('grid-field__icon-action--hidden-on-hover');

        $fieldEditor = GridField::create(
            'Fields',
            '',
            $fields,
            $config
        )->addExtraClass('uf-field-editor');

        return $fieldEditor;
    }
public function getFieldEditorGrid ( ) { Requirements :: javascript ( 'silverstripe/userforms:client/dist/js/userforms-cms.js' ) ; $ fields = $ this -> owner -> Fields ( ) ; $ this -> createInitialFormStep ( true ) ; $ editableColumns = new GridFieldEditableColumns ( ) ; $ fieldClasses = singleton ( EditableFormField :: class ) -> getEditableFieldClasses ( ) ; $ editableColumns -> setDisplayFields ( [ 'ClassName' => function ( $ record , $ column , $ grid ) use ( $ fieldClasses ) { if ( $ record instanceof EditableFormField ) { return $ record -> getInlineClassnameField ( $ column , $ fieldClasses ) ; } } , 'Title' => function ( $ record , $ column , $ grid ) { if ( $ record instanceof EditableFormField ) { return $ record -> getInlineTitleField ( $ column ) ; } } ] ) ; $ config = GridFieldConfig :: create ( ) -> addComponents ( $ editableColumns , new GridFieldButtonRow ( ) , ( new GridFieldAddClassesButton ( EditableTextField :: class ) ) -> setButtonName ( _t ( __CLASS__ . '.ADD_FIELD' , 'Add Field' ) ) -> setButtonClass ( 'btn-primary' ) , ( new GridFieldAddClassesButton ( EditableFormStep :: class ) ) -> setButtonName ( _t ( __CLASS__ . '.ADD_PAGE_BREAK' , 'Add Page Break' ) ) -> setButtonClass ( 'btn-secondary' ) , ( new GridFieldAddClassesButton ( [ EditableFieldGroup :: class , EditableFieldGroupEnd :: class ] ) ) -> setButtonName ( _t ( __CLASS__ . '.ADD_FIELD_GROUP' , 'Add Field Group' ) ) -> setButtonClass ( 'btn-secondary' ) , $ editButton = new GridFieldEditButton ( ) , new GridFieldDeleteAction ( ) , new GridFieldToolbarHeader ( ) , new GridFieldOrderableRows ( 'Sort' ) , new GridFieldDetailForm ( ) ) ; $ editButton -> removeExtraClass ( 'grid-field__icon-action--hidden-on-hover' ) ; $ fieldEditor = GridField :: create ( 'Fields' , '' , $ fields , $ config ) -> addExtraClass ( 'uf-field-editor' ) ; return $ fieldEditor ; }
Gets the field editor, for adding and removing EditableFormFields.

@return GridField
Gets the field editor for adding and removing EditableFormFields .