Skip to content

Use taggable dynamic content in other field dependsOn dynamically  #258

@couchlab-pl

Description

@couchlab-pl

Hi,

Hope someone know the solution or some update needed. Thanks in advance.

I have two fields, one to define list of possible choices, second to choose right answer.
Sadly when adding dynamic taggable values to the first field, second does not receive changed event.

Multiselect::make(('tr.task_choice_options'), 'choice_choices')->hide()->taggable()->saveAsJSON()
->dependsOn(
['task_type'],
function ($field, $request, $formData) {
if ($formData->task_type === TaskTypeEnum::Choice) {
$field->show()->required();
}
}
),
Multiselect::make(
('tr.task_choice_options'), 'choice_choice')->hide()->singleSelect()
->dependsOn(
['task_type','choice_choices'],
function ($field, $request, $formData) {
if ($formData->task_type === TaskTypeEnum::Choice) {
$field->options(json_decode($formData->choice_choices))->show()->required();
}
}
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions