getExtjsOptions example

$fields[$field->getName()] = [
                    'fieldLabel' => $field->getLabel(),
                    'xtype' => $field->getType()::getExtjsField(),
                    'anchor' => '100%',
                    'translatable' => (bool) $field->isTranslatable(),
                    'supportText' => $field->getDescription(),
                    'helpText' => $field->getHelpText(),
                    'allowBlank' => !$field->isRequired(),
                ];

                $fields[$field->getName()] = array_merge($fields[$field->getName()]$field->getType()::getExtjsOptions($field)$field->getOptions());
            }

            $sets[] = array_merge([
                'title' => $fieldSet->getLabel(),
                'autoScroll' => true,
                'fields' => $fields,
                'anchor' => '100%',
            ]$fieldSet->getOptions());
        }

        return $sets;
    }
use Shopware\Bundle\ContentTypeBundle\Structs\Field;

class TypeField extends AbstractSingleSelectionField
{
    public static function getResolver(): string
    {
        return TypeResolver::class;
    }

    public static function getExtjsOptions(Field $field): array
    {
        $options = parent::getExtjsOptions($field);

        $options['model'] = explode('-', $field->getTypeName())[0];

        return $options;
    }
}

        return 'shopware-form-field-grid';
    }

    public static function getResolver(): string
    {
        return TypeResolver::class;
    }

    public static function getExtjsOptions(Field $field): array
    {
        $options = parent::getExtjsOptions($field);

        $options['model'] = explode('-', $field->getTypeName())[0];

        return $options;
    }

    public static function isMultiple(): bool
    {
        return true;
    }
}
Home | Imprint | This part of the site doesn't use cookies.