I need to filter the gridview as you type. By default it filters only when the enter key is pressed.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You should handle this using your own js, e.g. :
$this->registerJs('$("body").on("keyup.yiiGridView", "#grid-id .filters input", function(){
$("#grid-id").yiiGridView("applyFilter");
})', \yii\web\View::POS_READY);
You should of course replace grid-id
with appropriate id.