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

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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

#1 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 01 June 2010 - 12:50 AM

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?

thanks.
0

#2 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,346
  • Joined: 12-October 09
  • Location:Croatia

Posted 01 June 2010 - 01:23 AM

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

or

.grid-view .filters select
Find more about me.... btw. Do you know your WAN IP?
0

#3 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 01 June 2010 - 02:00 AM

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.


thanks.
0

#4 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,346
  • Joined: 12-October 09
  • Location:Croatia

Posted 01 June 2010 - 02:43 AM

There is no easy solution as I know... for that you can use the 'filter' property - http://www.yiiframew...n#filter-detail, for every column...

and insert custom HTML code with the class or id you need...
Find more about me.... btw. Do you know your WAN IP?
0

#5 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 01 June 2010 - 03:00 AM

ok thanks.
i think, I just using css trick then ;D

just wonder want to know if any solution.

thx bro.
0

#6 User is offline   fastcrash 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 245
  • Joined: 10-March 10
  • Location:South Jakarta

Posted 02 June 2010 - 12:05 AM

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

...
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users