yii2-multiple-input icon indicating copy to clipboard operation
yii2-multiple-input copied to clipboard

No input with nested MultipleInput after remove

Open bscheshirwork opened this issue 6 years ago • 3 comments

For nested MultipleInput I not have a any data in $_POST for this field in case delete all rows. For 1st level I can see empty string (also is not good, but it exist).

I expect same behavior for 1st and 2st level of MultipleInput

bscheshirwork avatar Nov 14 '18 12:11 bscheshirwork

Post an example of the code, please.

unclead avatar Nov 17 '18 09:11 unclead

    <?= $form->field($model, 'nestedObjects')->widget(MultipleInput::class, [
        'rendererClass' => \unclead\multipleinput\renderers\ListRenderer::class,
        'max' => 6,
        'min' => 1,
        'allowEmptyList' => false,
        'enableGuessTitle' => true,
        'addButtonPosition' => MultipleInput::POS_HEADER, // show add button in the header
        'enableError' => true,
        'columns' => [
            [
                'name' => 'nested1', // attribute
                'title' => Yii::t('object', 'Nested1'),
                'type' => MultipleInput::class,
                'options' => [
                    'max' => 12,
                    'min' => 0,
                    'allowEmptyList' => true,
                    'enableGuessTitle' => true,
                    'addButtonPosition' => MultipleInput::POS_HEADER, // show add button in the header
                    'enableError' => true,
                    'columns' => [
                        [
                            'name' => 'nested2', // attribute
                            'title' => Yii::t('object', 'nested2'),
                        ],
                    ],
                ],
            ],
        ],
    ])
        ->label(false);
    ?>

bscheshirwork avatar Nov 19 '18 09:11 bscheshirwork