Alternate row color and focus color

QuestionsAlternate row color and focus color
Cedric asked 8 years ago

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

7 Answers
Abu Ghufran answered 8 years ago

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;
}

Cedric answered 7 years ago

thanks for your reply abu, but that still does not work…

Mike Olson answered 3 months ago

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.

Cedric answered 3 months ago

Hi Mike,
yes this code is to have alternate rows colored. So that is the expected behavior.

What are you trying to acheive?

Mike Olson answered 3 months ago

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.

 

Abu Ghufran Staff answered 3 months ago

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(''); }
_________________________
Abu Ghufran - Dev Team
Grid 4 PHP Framework
 
Your Answer

2 + 13 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?