I am trying to update yii2 grid view using pjax on keypress, Like by default in Yii2 grid view searching works on blur or on change event.
What I am looking for to overwrite this functionality on keypress.
Any help will be greatly appreciated. Thanks.
soul
(Soulgadn)
2
Hello, you can use something like this:
<?php Pjax::begin(); ?>
<?= \yii\grid\GridView::widget([
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
'id',
'email',
'fio',
],
]); ?>
<?php Pjax::end();?>
<?php $this->registerJs('jQuery("#w0").on("keyup", "input", function(){
jQuery(this).change();
//OR $.pjax.reload({container:\'#w0\'});
});',
yii\web\View::POS_READY);
I appreciate your efforts, I have tried this block of code, but this code reload grid view with the current request.
But what I need to send a request with updated data and update on basis of that.
In this case also when pjax fire, it return complete page layout instead of table data.