public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        // Field visible on edit only
        if ($this->isInDB()) {
            $config = GridFieldConfig_RelationEditor::create();
            $config
                ->getComponentByType('GridFieldPaginator')
                ->setItemsPerPage(10);
            $config->removeComponentsByType('GridFieldAddNewButton');
            $config->removeComponentsByType('GridFieldEditButton');
            $config
                ->getComponentByType('GridFieldDataColumns')
                ->setDisplayFields([
                    'Name'  => _t('Moo_EditableFieldGroup.NAME', 'Name'),
                    'Title' => _t('Moo_EditableFieldGroup.TITLE', 'Title'),
                    'Sort'  => _t('Moo_EditableFieldGroup.SORT', 'Sort'),
                ]);
            $config->addComponent(new GridFieldOrderableRows('Sort'));
            $field = new GridField('Fields', 'Fields', $this->Fields(), $config);
            $fields->addFieldToTab('Root.Fields', $field);
        }

        return $fields;
    }
public function getCMSFields()
    {
        $fields = parent::getCMSFields();

        // Field visible on edit only
        if ($this->isInDB()) {
            $config = GridFieldConfig_RelationEditor::create();
            $config
                ->getComponentByType('GridFieldPaginator')
                ->setItemsPerPage(10);
            $config->removeComponentsByType('GridFieldAddNewButton');
            $config->removeComponentsByType('GridFieldEditButton');
            $config
                ->getComponentByType('GridFieldDataColumns')
                ->setDisplayFields([
                    'Name'  => _t('Moo_EditableFieldGroup.NAME', 'Name'),
                    'Title' => _t('Moo_EditableFieldGroup.TITLE', 'Title'),
                    'Sort'  => _t('Moo_EditableFieldGroup.SORT', 'Sort'),
                ]);
            $config->addComponent(new GridFieldOrderableRows('Sort'));
            $field = new GridField('Fields', 'Fields', $this->Fields(), $config);
            $fields->addFieldToTab('Root.Fields', $field);
        }

        return $fields;
    }
Returns form fields for adding/editing the data object.

@return FieldList