In my view, I have style -> grid, and then I have settings -> grouping field set to taxonomy term. This effectively sorts the grid view into multiple tables, one for each term.

Having multiple tables on the page seems to confuse this module and it starts trying to insert content in all of the tables. It also does not create new table headers for group headers that were off the screen during the load of the first N number of items.

I have no patch for this one at this time, just reporting it for now.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

rjbrown99’s picture

Remon’s picture

Title: Does not properly insert comment on grid views that have a grouping » Support views grouping
Category: bug » feature
SpaceGoat1701’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

Has any progress been made on this for the D7 version?

michaelfavia’s picture

Nope this is still not supported. I have a clien tthat needs it so i may take ahack ill patch here if i do.

brandont’s picture

Any progress on getting the group by completed?

nicholasThompson’s picture

Not entirely sure I understand why this doesn't work - the normal pagination system is fine.

scito’s picture

I closed the duplicate #1626728: Views Infinite Scroll doesnt seem to support grouping field.

@nicholasThompson: It's really strange. I don't understand what causes this problem.

scito’s picture

FileSize
2.34 KB

I've found the problem. The current code assumes only one .item-list. But grouping introduces several .item-lists and additionally a grouping title (h3) for each list.

I've fixed it for my case and added this patch. The matching is a level higher similar to the default case. Duplicate titles are removed in JS.

I think the patch should be improved for a general solution, e.g. the h3. But it might help already.

scito’s picture

Status: Active » Needs work
dankobiaka’s picture

Status: Needs work » Needs review
FileSize
1.81 KB

Patch attached to support grouping for unformatted list style.

Jibus’s picture

Status: Needs review » Needs work

Thanks for very much your patch dankobiaka !

Applyed patch againt the 7.x-1.x version with an unformatted list style.

Almost worked, the grouping title field appears correctly but too often.
For instance, i set a grouping field which wraps 50 nodes title link with a pager set to 10:

Behavior without infinite scroll

-- Group field title --
Node 1 title
Node 2 title
Node 3 title
...
Node 10 title
More link

With infinite scroll and your patch

-- Group field title --
Node 1 title
Node 2 title
Node 3 title
...
Node 10 title
-- Group field title --
Node 11 title
Node 12 title
Node 13 title
...
Node 20 title
-- Group field title --
Node 21 title
Node 22 title
Node 23 title
...
Node 30 title

etc..

I think that the correct behavior should be:

-- Group field title --
Node 1 title
Node 2 title
Node 3 title
...
Node 10 title
*/ Load Infinite scroll /*
Node 11 title
Node 12 title
Node 13 title
...
Node 20 title
*/ Load Infinite scroll /*
etc..

Sorry if my explainations wasn't clear enough =)

dankobiaka’s picture

Yes I see the problem you're referring to.

That is a much tougher one to solve IMO. How do you determine which group titles are duplicates?

However, I think this is a minor problem compared to not having views grouping supported at all.

Jibus’s picture

Status: Needs work » Needs review

I agree. I don't know how to determine which group titles are duplicated.

Reset this to "Need review".

For me, works as expected

Lythimus’s picture

Version: 7.x-1.x-dev » 7.x-1.1
FileSize
415 bytes

I had more luck doing this with HTML list in a view with single level grouping. Sorry about the diff-based patch and not git-based patch. I might be able to come back later and create a real Drupal patch.

This does not resolve comment-6538560 #11 above. I believe that would require closer integration with views on how many rows to return. I agree though, that would be expected behavior and again, hopefully I will find time to contribute it.

Edit: In my haste I realized I applied the patch backwards. It should read as found here on pastebin.

trackleft’s picture

What if we could choose how many groups to show rather than how many results? Does anyone think this is possible? For example, I'd like to create an infinite scroll list of events grouped by day and load 30 days for each page.

I bet we could look in the date module at their mini calendar view widget for how this is done.

patrickroma’s picture

Is there any news on this? Would be really cool to use in combination with Date-Field to sort with Time-Based-Grouping...

infines’s picture

I feel like perhaps there should also be an option to load by # of groups:

Group 1
item1
item2
item3
item4

infinite scroll load...

Group 2
item1
item2
item3
...
item 10

infinite scroll load...

Group 3
item 1
item 2
item 3
item 4
...
item 8

som30ind’s picture

This patch fixes paging issues when grouping enabled using "Table" plugin.
The issues fixed in this patch are:
1) It makes the group headers available in the next pages.
2) It merges the table contents with same header in previous page and the current page.
Eg,

Page 1:

Group A
Item 1
Item 2
Item 3
Item 4
Item 5

Page 2:

Group A
Item 6
Item 7
Group B
Item 1
Item 2
Item 3

Page 3:

Group B
Item 4
Group C
Item 1
Item 2
Item 3
Item 4

It will output on 3rd page like:

Group A
Item 1
Item 2
Item 3
Item 4
Item 5
Item 6
Item 7
Group B
Item 1
Item 2
Item 3
Item 4
Group C
Item 1
Item 2
Item 3
Item 4
som30ind’s picture

Fixed one small issue on merging common groups on the previous patch.

rjbrown99’s picture

Looks great to me, I'd vote to include it in the main CDN module.

ashwinsh’s picture

#10 : Posted by dankobiaka on September 10, 2012 at 7:45am
Works for me. Thank you dankobiaka.

maximilianmikus’s picture

#19 worked for me. Had to change the table row selector from "tr" to "tbody tr" though. Would be nice if this would be configurable.

Nigel Cunningham’s picture

Issue summary: View changes
FileSize
7.86 KB

I had stripping disabled in my view, and therefore noticed that the patch wasn't honouring that setting. Attaching a new version that addresses this omission.

romansta’s picture

#19 worked for me with the following changes - I use the HTML list:

      case 'list':
       if ($group_settings['uses_grouping']) {
          $content_selector = 'div.view-content';
          $items_selector = '.item-list';
          $group_settings['group_title_selector'] = 'h3';
          $group_settings['group_row_selector'] = 'ul';
        }
        else {
         if (array_key_exists('wrapper_class', $style_options) && !empty($style_options['wrapper_class'])) {
           $wrapper_class = '.' . $style_options['wrapper_class'];
         } else {
           $wrapper_class = '.item-list';
         }

ben833’s picture

Thank you @romansta for your solution for HTML List. The patch doesn't fix unformatted yet, though.

leahtard’s picture

#10 works great. Thanks @dankobiaka.

parkout’s picture

Do u have some patch for Drupal 6? very need!

nicholas.alipaz’s picture

Anonymous’s picture

#10 and #28 work for me.

Re-re-roll from #10 (or re-roll from #28) against 7.x-1.1

smitty’s picture

Unfortunately this is not working for me (using the unformatted list). I applied #19 and #29. But then no more page got loaded any more. The icon is blinking at the and of the page but no more content is loaded.

After removing 'group_settings' => $group_settings, (from #19) content is reloaded again. But at the beginning of each "new page" the gouping-headline is displayed.

liquidcms’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Status: Needs review » Needs work

i don't think this is working yet. Using latest -dev and patch from 28 i get the following:

HTML List
- odd effect that it seems to be autoscrolling even though i am not at the end of the page
- the grouping header is shown at the very top for the first group; but no others are ever shown

Unformatted List
- this is the closest to working
- everything works correctly except the next page always lists the current group header at the top of that page (even when it is in the middle of a group)

ToxaViking’s picture

Have interesting problem. I have view with unformatted list of field which are frouped. At the setting I set up 10 elements per page. After ajax loading I see group header again. How to fix it? Sorry for my English

ABaier’s picture

This problem still seems to exist in the drupal 8 version. I have a view of event dates grouped by month, formatted as unformatted list. If new entries are loaded by infinite scroll, the previous group title (month) will be inserted again, like explained in comment #18.

Any solutions yet?

FYI: I think I remember switching to "views_load_more" module for a previous d7 project, that seemed to have solved this issue. Maybe there could be found a solution.

colepacak’s picture

#29 worked liked a charm with 7.1.1. Thanks, Deraynger.

firewaller’s picture

Status: Needs work » Reviewed & tested by the community

#29 works for me as well.

Honza Pobořil’s picture

Status: Reviewed & tested by the community » Needs review

It seems there are unresolved problems with patch and also it does not have enought reviews.

Honza Pobořil’s picture

Status: Needs review » Closed (outdated)

7.x-1.x will receive no work. Migrate to 7.x-2.x.