contributte / forms-multiplier

:repeat: Form multiplier & replicator for Nette Framework
https://contributte.org/packages/contributte/forms-multiplier.html
MIT License
26 stars 21 forks source link

How to set defaultValues for two nested multipliers? Possible bug #26

Closed BigOHenry closed 6 years ago

BigOHenry commented 6 years ago

Hello, i have problem with setting default values into two multipliers (second multiplier is inside first one).

i have this kind of array with default values:

$defaultValues = array(
                    0 => array(
                        'input1' => 'val1',
                        'input2' => 'val2',
                        'multiplier_child' => array(
                            0 => array(
                                'input3' => 'val3'
                            ),
                            1 => array(
                                'input3' => 'val4'
                            )
                        )
                    ),
                    1 => array(
                        'input1' => 'val5',
                        'input2' => 'val6',
                        'multiplier_child' => array(
                            0 => array(
                                'input3' => 'val7'
                            )
                        )
                    )
                );

Default values are set into input1 and input2 correctly, but input3 is empty at both containers.

Do i have right array for default values?

BigOHenry commented 6 years ago

Wow, thank you for light speed fix :-) Its working now