Basically, the odd and even css tags are not being applied to the grid.

Had to edit theme/theme.inc be adding the following:

$row_classes[] =  'row-' . (($row_number + 1) % 2 ? 'odd' : 'even');

Please see the following code snippet:

    if ($row_class_special) {
      $row_classes[] =  'row-' . (($row_number + 1) % 2 ? 'odd' : 'even');
      if ($row_number == 0) {
        $row_classes[] =  'row-first';
      }
      if (count($rows) == ($row_number + 1)) {
        $row_classes[] =  'row-last';
      }
    }

Testing working. Added some CSS to my custom theme CSS and good to go. Not sure why the row-first and row-last were included but the striping code was omitted.

Files: 
CommentFileSizeAuthor
#9 1863358-grid-format-striping-8.patch443 byteshaydeniv
PASSED: [[SimpleTest]]: [MySQL] 1,627 pass(es).
[ View ]

Comments

Status:Needs review» Needs work

Please always provide a patch because everything else is simply horrible to review.

Status:Needs work» Needs review

Please advise on the proper process for submitting patches? Anyway I can easly obtain the original file (as I did not save it before modifying)?

Status:Needs review» Needs work

When using grid, and I have striping unchecked, striping remains. This is a theme issue and not views.

Dont think so, if you look at the code I had to add to theme/theme.inc (which is base drupal 7 file AFAIK), striping information was missing.

Just to clarify, this is when using Views, Format 'Grid', Show 'Fields'.

ah, I see what you saying.
---
my grid stack is looking like this with those settings

<div class="view-content">
<table class="views-view-grid cols-3">
<tbody>
<tr class="row-1">
<td class="col-1">
<div class="views-field views-field-title">
<span class="field-content">
...

in my case the grid striping setting has no effect because the table is using my custom theme css.

Thank you. That helped me.
Please add to the next version.

Version:7.x-3.5» 7.x-3.x-dev
Status:Needs work» Needs review

This is still a problem in the latest version. This patch addresses it.

StatusFileSize
new443 bytes
PASSED: [[SimpleTest]]: [MySQL] 1,627 pass(es).
[ View ]

Helps to attach patch.

Thanks for the patch. It worked for me.

Status:Needs review» Reviewed & tested by the community

Looks like this is ready to go unless we need a test for this tiny change.

I think the issue applies to both grids and tables. My table formats are not respecting the striping checkbox (first, even/odd and last classes only).

Lines 632-635 from the tables section of theme.inc:

  if ($row_class_special) {
    $vars['row_classes'][0][] = 'views-row-first';
    $vars['row_classes'][count($vars['row_classes']) - 1][] = 'views-row-last';
  }

Issue summary:View changes

Yeah, added some text highlighting within code tags, didnt work well.... correcting.

The patch in #9 applies striping classes of "row-odd" and "row-even" in the function template_preprocess_views_view_grid().

Meanwhile, it looks to me as if template_preprocess_views_view_table() applies striping classes of "odd" and "even" while template_preprocess_views_view_unformatted() applies striping classes of "views-row-odd" and "views-row-even".

Would it not be better to use the same class names for striping for Grid, Table and Unformatted outputs?

Issue summary:View changes
Status:Reviewed & tested by the community» Needs work

Would it not be better to use the same class names for striping for Grid, Table and Unformatted outputs?

Changing the current classes in existing sites will cause avoidable damage. Can't we manually opt in for those classes?

I haven't seen stripes on grids often.