private function filterRecordEditingFields(FieldList $fields, $id)
    {
        $config = $this->component->getConfig();
        $editableFields = $config['editableFields'];

        // get all dataFields or just the ones allowed in config
        if ($editableFields) {
            $dataFields = array();

            foreach ($editableFields as $fieldName) {
                $dataFields[$fieldName] = $fields->dataFieldByName($fieldName);
            }
        } else {
            $dataFields = $fields->dataFields();
        }

        // escape field names with unique prefix
        foreach ($dataFields as $name => $field) {
            $field->Name = $this->escapeFieldName($id, $name);
            $dataFields[$name] = $field;
        }

        return $dataFields;
    }