Hello.
I want to remove the filter from the header in GridView. I am trying with: 'layout' => "{summary}\n{items}\n{pager}", but it doesn't work.
http://www.yiiframework.com/doc-2.0/guide-output-data-widgets.html#filtering-data
Use Yii forum for asking.
Just hide omit the filterModel config item from your gridview constructor
<?= GridView::widget([
'dataProvider' => $dataProvider,
// 'filterModel' => $searchModel,
'columns' => [
.....
]
]);
?>
You shoud hide the filter model than your filter will be remove.Please check the below code.
GridView::widget([
'dataProvider' => $dataProvider,
//'filterModel' => $searchModel,
'columns' => [
['class' => 'yii\grid\SerialColumn'],
'post_id',
'post_title',
'post_description:ntext',
'user_id',
['class' => 'yii\grid\ActionColumn'],
],
]);
I was also searching for this. thanks I just removed it.
Most helpful comment
Just hide omit the filterModel config item from your gridview constructor