Hello,
I have used this code from the demo
$grid["altRows"] = true;
$grid["altclass"] = "myAltRowClass";
<style>
tr.focus-row
{
background: green;
color: black;
}
tr.focus-out
{
background: lightgrey;
color: black;
}
tr.focus-teal
{
background: teal;
}
.focus-cell
{
background: red;
color: black;
}
</style>
<style>
/* alternate row color */
.myAltRowClass { background-color: #F1F1F1 !important; background-image: none !important; }
/* first row color */
.ui-jqgrid tr.jqgroup, .ui-jqgrid tr.jqgrow { background-color: inherit; background-image:none; }
</style>
It looks fine, but when I focus a row it only work for row that have a white background…
Do you know how to fix this?
Thanks
Cedric
Hello,
You can add following with !important option at end.
.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight
{
background: #fbec88 url("images/ui-bg_flat_55_fbec88_40x100.png") repeat-x scroll 50% 50% !important;
}
Working demo: http://www.phpgrid.org/demo/demos/appearance/alternate-row.php
Code: http://www.phpgrid.org/demo/demos/appearance/alternate-row.phps
Sorry to resurrect this but you know that your code doesn\’t work right? Like the demo is even not working correct. Notice how it the cursor movement only highlights every other row.
Hi Mike,
yes this code is to have alternate rows colored. So that is the expected behavior.
What are you trying to acheive?
First,
On my end the mouse pointer only highlights one of the two alternating rows when moving the cursor over them. So basically if I run my mouse over the list only the white rows get highlighted as I move my cursor. That is not how it should work.
Second,
When I use this code my rows are not alternating colors.
Hello,
I understand what you mean, and I’ve fixed this case.
You need to update line 169 of the above code.
https://www.gridphp.com/demo/demos/appearance/alternate-row.phps
I removed the !important tag from the style and it’s now working as expected.
Thanks for reporting.
.myAltRowClass { background-color: #F1F1F1; background-image: url(''); }