yii2-multiple-input - Add and remove row in the middle

469 views Asked by At

I am working on a project and using yii2-multiple-input, but I would like to be able to add the row in the middle.

Do you know if this is something that we can do using yii2-multiple-input or do I have to try another approach?

Thanks!

1

There are 1 answers

0
Nuriddin Kamardinov On

There is a way to sort rows in multiple input:

$form->field($model, 'attribute')->widget(MultipleInput::className(), [
    'sortable' => true
]);

After adding a new row in the last position, you can move it wherever you want.

For more information, check here.