Yii2 Pjax not working
I want to refresh the gridview using Pjax but somehow it is not working. Here is the code: _search.php <?php use yii\helpers\Html; use yii\widgets\ActiveForm; use yii\widgets\Pjax; $this->registerJs(" $('#btnAjaxSearch').click(function(){ $.ajax({ type: 'get', data: $('.bank-search form').serializeArray(), success: function (data) { $.pjax.reload({container:\"#bank\"}); }, error: function (XMLHttpRequest, textStatus, errorThrown) { alert('error'); } }); return false; }); ", \yii\web\View::POS_END, 'bank-search'); ?> <div class="bank-search"> <?php Pjax::begin(['id' => 'bank-form']); ?> <?php