Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Yii CGridView hide filter input only

Tags:

yii

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?

like image 567
Flavio Avatar asked Nov 20 '12 22:11

Flavio


2 Answers

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

should work.

like image 133
zuups Avatar answered Nov 20 '22 20:11

zuups


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

like image 40
gabo bernal Avatar answered Nov 20 '22 20:11

gabo bernal