I’m making a form with has Pjax inside ActiveForm so user can quick filter and select recent user, it seems like everytime I use pjax it also submit the form and active clientValidation
<?php
use kartik\grid\GridView;
use kartik\grid\RadioColumn;
use yii\bootstrap\ActiveForm;
$form = ActiveForm::begin([
'id' => 'customer-search-form',
'method' => 'post',
]);
?>
<?=
GridView::widget([
'dataProvider' => $controller->DPRecentProjects,
'pjax' => true,
'filterModel'=> $controller->SMProject,
'export' => false,
//'itemView' => '//site/_customer_list_item',
'id' => 'recent-projects',
'tableOptions' => ['class' => 'table'],
'layout' => "{items}\n{summary}",
'columns' => [
[
'class' => RadioColumn::className(),
'name' => 'NewProjectForm[from_recent]',
],
'title',
]
]);
?>
<?= $form->field($NewProjectForm, 'Project_title') ?>
<?php ActiveForm::end(); ?>
The Pjax filter worked but it needed to reload the page, I tried something like this in controller but it doesn’t work
if (!Yii::$app->request->isPjax && $this->NewProjectForm->load($post) && $this->NewProjectForm->validate())
{
// create project
}