Home › Forums › Guriddo jqGrid JS › Help › altRows not working
I am trying to use the altRows feature.
Can you please check out the version and the Theme you are using? Some of the ThemeRoller themes shipped do not support that (or it is very hardly visibile – for example the Redmond theme and the Start theme). You can check out with the UI Darkness for example.
This might be due to the theme you're using. Try adding altClass: 'altRow' and then add something like this to your css file:
.ui-jqgrid .altRow td{background-color: red;}
If this does work, then the problem was theming.
Theme is smoothness.
Table id is “grid”.
When you add an altRows:true to your options object, you get .ui-priority-secondary class on every next row, you can add a css rule yourself, at least that's how I do it.
But my problem is little different. altRows option works good at first, I get zebra grid, but it doesn't keeps it that way after sorting operation on any column. Rows get messed. Is there any established way to deal with this “issue”?
tgueth,
You don't only have to add the CSS I gave you, but in your grid config you have to add this as well:
altClass: 'altRow',
altRows: true
Still does not work after
Mess around with the CSS. Very small differences to the CSS can suddenly make it work. Try the exact CSS I gave you, it worked for me in combination with altClass: 'altRow'.
Still no luck.
Hello,
There was a bug when we use datatype local (already fixed), but this is not your case. In some themes there is no diffrence with the alt rows, by example redmond. Try with other theme and see the result.
Regards
Tony
I have tried “smoothness”, “Redmond” (which you state will not show difference with “altRows” because of its CSS) and “Vader” – none which show a difference in the alternate rows.
If you tried another theme, make sure you left out the option altClass: 'altRow', because the jQuery Theming uses a default altClass, which is different from 'altRow' (something like ui-second-priority). Try the theme UI Darkness as Rumen said, because in smoothness and Redmond the alternating rows are not or hardly visible.
If you have Firefox web developer extension installed, check the generated source of your jqgrid by right clicking your page: Web Developer – View Source – View generated source. There you can see if the CSS classes are added to the alternating rows of your jqgrid, and also what the name of the class is.
Tom, I have created for you a altRows example here:
http://www.trirand.net/examples/appearance/alternate_row_background/default.aspx
Please, take a look at it and experiment with all the Themes available (25 of them) in the “Themes” tab below the example. You will notice that some theme roller themes do not support altRows, some do, some have very hardly visible differences.
Also, run FireBug for FireFox and check out how our setup is different from yours. Another thing to watch for – which version are you using? Please, try the very last official release (I believe 3.5.3 if I am not mistaken, 3.6 is still in beta).
Hopefully we can work this out.
Rumen Stankov
Hospital_Ghost: was not able to Darkness to work at all so I am sure I have a folder reference wrong.
Is there some reason that IE does not show different background for alternating rows?
Yes, I see. In IE it is really different than FireFox / Chrome / Safari. In this particular example:
http://www.trirand.net/examples/appearance/alternate_row_background/default.aspx
and choosing UI Darkness from themes, the alternating background is clearly visible for the aforementioned browsers and hardly visible (I think only the foreground color is a bit different, but not background).
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top