M
M
Mikha Pankratov2015-12-11 15:04:14
Yii
Mikha Pankratov, 2015-12-11 15:04:14

How to render a view when adding a field ajax?

Hello
my form

<?php $form = ActiveForm::begin([
                        'enableClientValidation' => true,
                        'options' => [
                            'enctype' => 'multipart/form-data',
                        ],
                    ]); ?>

my action -
public function actionDelete($id)
    {
        $model = $this->findModel($id);
        $model->delete();
        return $this->renderAjax('my_view', ['models' => $model]);
    }

And it is displayed after deleting and adding the field with ajax, not at all like in a fairy tale.
uploaded a picture) joxi.ru/Rmzkw9zIW0VJl2

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2015-12-11
@frmax

Use PAjax
renderAjax returns a view without layout

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question