How add css class to each input field for search ajax form in cgridview - filterCssClass?

hi all,

how to add class/style to each input fields for search ajax form in cgridview.

i have my own css class for each input type.

the original css, ‘filters’ not look good in IE6.

i know there is method filterCssClass, but this only effect for tr tag.

any idea?


Indeed, the class filters is added only to the TR tag…

I just make a new CSS file like css/myproject.css and include it in the layouts/main.php as the last one, and then redefine there what I want to change…

For the filters use the:

.grid-view .filters input


.grid-view .filters select

oh, mdomba i miss u… :D

thanks for reply.

but how to assign different size for each input field?

because in IE6 the size of input field is overflow.

i try ‘overflow:hidden’, but not work too.

i know IE6 is an old, but a lots of people still using it.

other browser is fine.


There is no easy solution as I know… for that you can use the ‘filter’ property -, for every column…

and insert custom HTML code with the class or id you need…

ok thanks.

i think, I just using css trick then ;D

just wonder want to know if any solution.

thx bro.

I got it.

'filter'=>CHtml::textField('t_news[title]', '', array('style'=>'width:140px')),

this one solve tidy warning issue with empty option value:

'filter'=>CHtml::DropDownList('t_news[Status]', '', array('00'=>'No','01'=>'Yes'), array('id'=>'t_news_Status_filter', 'empty'=>'Select Status')),

the name field is hard coded, i dont like it either…

Dropdown list filter not working in IE6

Someone said this is a bugs