Pjax works well with GridView widget in a Pjax::begin() and Pjax::end() block.
But with activeform the page reloads after pjax request. I’ve confirmed that the pjax works on the form with the following js code.
$(document).on(‘pjax:end’, function(event) {
alert('end');
});
<?php yii\widgets\Pjax::begin() ?>
<?php $form = ActiveForm::begin(['options' => ['data-pjax' => true ]]); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => 200]) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
<?php yii\widgets\Pjax::end() ?>