Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Не работает reactive() в поля внутри Template #1478

Closed
Eroha186 opened this issue Jan 16, 2025 · 1 comment
Closed

Не работает reactive() в поля внутри Template #1478

Eroha186 opened this issue Jan 16, 2025 · 1 comment

Comments

@Eroha186
Copy link

Description

При построении полей для сохранении json поля(как это делалось можно посмотреть тут).
У полей внутри Template не срабатывает реактивность.

Template::make(column: 'config')
    ->fields([
            Select::make('test', 'test')
                ->searchable()
                ->reactive(function (Fields $fields, ?string $value, Field $field, array $values) {
                    // Ставим брейкпоинт. Остановки не происходит
                    $a = 0;
                })
                ->async('/search'),
            Select::make('test 1', 'test_1')->reactive(),
    ])
    ->changeRender(fn (mixed $value, Template $ctx) => FieldsGroup::make($ctx->preparedFields()))
    ->onApply(function (mixed $item, mixed $values) {
        $item->config = $values ?: [];
        return $item;
    });
@lee-to
Copy link
Collaborator

lee-to commented Jan 25, 2025

В таком виде и не будет, будет работать через Template()->reactive в 3.4 но Template также подразумевает правильно настроенную логику

@lee-to lee-to closed this as completed Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants