Pjax

I have followed the steps on implementing the Ajax Search With the GridView on the definitive guide but the search only works after keypress or mouse click. Below is my code snippet What am Missing in my code?


<?php


use yii\helpers\Html;

use yii\grid\GridView;

use yii\Widgets\Pjax;


/* @var $this yii\web\View */

/* @var $searchModel backend\models\CompaniesSearch */

/* @var $dataProvider yii\data\ActiveDataProvider */


$this->title = 'Companies';

$this->params['breadcrumbs'][] = $this->title;

?>

<div class="companies-index">


    <h1><?= Html::encode($this->title) ?></h1>

    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>


    <p>

        <?= Html::a('Create Companies', ['create'], ['class' => 'btn btn-success']) ?>

    </p>

	

	<?php Pjax::begin(); ?>


    <?= GridView::widget([

        'dataProvider' => $dataProvider,

        'filterModel' => $searchModel,

        'columns' => [

            ['class' => 'yii\grid\SerialColumn'],

            //'company_id',

            'company_name',

            'company_email:email',

            'company_address',

            'company_created_date',

            //'company_status',

            ['class' => 'yii\grid\ActionColumn'],

        ],

    ]); ?>

	

	<?php Pjax::end(); ?>

</div>



You have to be more specific to get an answer. At a minimum you need to add an ID to the pjax widget, however, this most likely wont solve your problem.