How can I change color of visited cgridview row?


Tags: javascript,jquery,css,yii,cgridview

Problem :

I will need have changed visited row in CGridView on another color. What do I need to do to solve it? I found JavaScript or CSS way, but I didn't find any even approximate method. I know what I can change visited link

a:visited
{
    color: #green;
}

but how do I change color of visited row? Maybe, does Jquery have some method?

UPD: I have a CGridView table, I need to visited rows looked another color.

$this->widget('zii.widgets.grid.CGridView', array(
  'dataProvider'=>$dataProvider,
  'columns'=>array(
    'title',          
    array(            
        'name'=>'authorName',
        'value'=>'$data->author->username',
    ),
    array(
        'class'=>'CButtonColumn',
    ),
),
));

How will have I done?



Solution :

Try so:

$this->widget('zii.widgets.grid.CGridView', array(
  'selectableRows'=>1,
  'selectionChanged'=>'function(id){
        var selected_tr = $.fn.yiiGridView.getSelection(id);
        $("#"+id).find("tr#"+selected_tr).css("background-color", "red");
        }',
  'dataProvider'=>$dataProvider,
  'columns'=>array(
    'title',          
    array(            
        'name'=>'authorName',
        'value'=>'$data->author->username',
    ),
    array(
        'class'=>'CButtonColumn',
    ),
),
));

Is that what you want?


    CSS Howto..

    how to link stylesheet in css

    How to color portion of text using css or jquery

    How to highlight syntax inside
    tag?

    How do I vertically center my navigation bar?

    How can display table-row behave like colspan=3

    Is there a limit to how deep an HTML document or CSS tree can be?

    How to recalculate css with jQuery window resize?

    ASP.net - How to achieve CSS with constant values, arithmetic and string manipulation

    How can I include a CSS stylesheet in an XSL document for Internet Explorer?

    How to style ul horizontally

    How to stretch segment of image in html/css

    How can I style jQuery-UI autocomplete differently than jQuery-UI tabs?

    css - how to stretch a background image across the entire window

    How to customize style of numeric “li” in css [closed]

    How to add a google map icon to this code?

    how to move scrollbar from left to right in css?

    How to handle an id tag with '.' in CSS

    How to prevent a closing tag from being removed?

    How to get the CSS attributes from a control located by XPath using Selenium IDE

    How To Add Links To Right Of Header?

    How to remove style type css wordpress from header?

    How to stop all CSS overrides on a container DIV?

    How to make div elements inside a div background image responsive using css

    How to control the size of a table cell in css

    How to create a mouseover effect on menu links EXCEPT for the current page?

    By CSS, how to make page height not change when an element is moved down

    CSS: How to center texts with transitioning position?

    how to remain the style of GUI component after disabling it in javafx?

    CSS/Menu: How to position element right below/beside elements

    How to get overlay to fill scrollable parent using pure CSS?