Skip to content

Conversation

junamai2000
Copy link

@junamai2000 junamai2000 commented Mar 11, 2024

The conditional form generator is not work properly when IN operator is used.

        $form->select('some_type'))
            ->rules('required')
            ->options([1, 2, 3, 4, 5])
            ->when('in', [
                1,
                2,
            ], function (Form $form) {
                $form->hasMany('xxxx', 'yyyyyy', function (Form\NestedForm $nested_form) use ($form) {
                    // do something
                })->useTable();
            });

In this case above, cascade_groups is generated like this.

var cascade_groups = [{"class":"cascade-type-312d32","operator":"in","value":["1","2"]}];

and hide class is not removed correctly because the value is not expect array.

if(default_value == event.value) {

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

Successfully merging this pull request may close these issues.

1 participant