Yii CGridView hide filter input only

yii
14,615

Solution 1

array(
    'name'=>'col3',
    'value'=>'$data->col3',
    'filter'=>false,
)

should work.

Solution 2

If you want to remove all filters form the entire CGridView, configure 'filterPosition'=>''

Share:
14,615
Flavio
Author by

Flavio

Senior web developer, focused on Wordpress template and plugin development and Yii framework for webapps.

Updated on July 27, 2022

Comments

  • Flavio
    Flavio almost 2 years

    When using CGridView, the filter input fields are automatically generated by the component.

    I want to select which columns will show the input field. For example: My model has 5 columns. I want CGridView to show the input filter ONLY for columns 1 and 2.

    Is there a way to do it without using CSS or jQuery, just adding some code on the CGridView options?

  • Dmitry Davydov
    Dmitry Davydov almost 8 years
    It seems like a hack, because it is not documented yiiframework.com/doc/api/1.1/CGridView/#filterPosition-detai‌​l