Filter on input in yii2 gridview

I need to filter gridview on input. By default, it is filtered only when you press the enter key.

+5
source share
1 answer

You have to deal with this using your own js, for example.

$this->registerJs('$("body").on("keyup.yiiGridView", "#grid-id .filters input", function(){ $("#grid-id").yiiGridView("applyFilter"); })', \yii\web\View::POS_READY); 

Of course, you must replace the grid-id with the corresponding identifier.

+3
source

Source: https://habr.com/ru/post/1212784/


All Articles