Open DMeganoski opened 1 year ago
Do you solve it?
@boris-shakhverdyan I instead leveraged the default 'dependsOn' function.
Instead of hiding the field in some cases, the field is always there, but inside the 'dependsOn' callback I am using $field->options($newOptions)
to set the available items when another field changes.
@boris-shakhverdyan I instead leveraged the default 'dependsOn' function.
Instead of hiding the field in some cases, the field is always there, but inside the 'dependsOn' callback I am using
$field->options($newOptions)
to set the available items when another field changes.
DependencyContainer::make([ Text::make("test")->dependsOn(["info"], function($field, $request, $formdata) { //This function not run } ])->dependsOnNotEmpty("key2")
I am trying to build a somewhat complex form, which has several dependency containers.
Let's use the examples 'provider' and 'service'. Let's say that each provider has it's own list of services. This is easy to achieve with this package.
The problem is if I want to add a third field that depends on the value of the service selected.
If I use
->dependsOn('service', 'value')
this does not seem to pick up the value and does not show the container when it should.Is there some prefix I need to add to 'service' since it's inside a dependency container?
Any suggestions are much appreciated.