ng-table icon indicating copy to clipboard operation
ng-table copied to clipboard

Grouping & paging

Open karolbe opened this issue 13 years ago • 7 comments

When grouping is enabled together with paging grouping does not process all items in the data-grid but rather only items from a single page. This should not work like this in my opinion, groups should be created from all available data.

karolbe avatar Nov 24 '13 19:11 karolbe

+1

ribbitfix avatar Jan 22 '14 18:01 ribbitfix

I'm here for the inevitable +1. This behavior is very confusing for the user. Let me demonstrate with pics.

Here is grouping with the pager set to 10

screen shot 2014-06-29 at 10 37 05 pm

..and here is the same data set showing group with the pager set to 50. Notice how we now see more items under the (FOOD) category? This is infinitely confusing to a user. I think they expect to see the full number of items regardless of what the pager is set at.

screen shot 2014-06-29 at 10 39 09 pm

I have not dug into the code yet to see if there are options to fix this behavior, but as a default, I think this is the wrong choice. It might be nice to provide this as an optional behavior, but by default I think it should display the total # of rows under a group regardless of what the pager number is set to.

davisford avatar Jun 30 '14 02:06 davisford

anyone investigate a workaround for this? i really have to get this fixed, so i'm going to look at ng-table.js and see if there isn't an easy way to resolve it. just thought i'd inquire here first if anyone else has already done it?

davisford avatar Jul 11 '14 02:07 davisford

Ah, silly me -- this is easily fixed if you provide an initial sorting array that is just based on the group property.

For example, in my screenshot above, I group on category, so if I just setup the table like this:

$scope.tableParams = new TableParams({
  page: 1,
  count: 50,
  sorting: { category: 'asc' }
}, { /* etc. */ }
});

It resolves the issue. Of course, if you have sorting enabled on other columns, and you sort, you won't be sorted by just the grouped property anymore.

davisford avatar Jul 12 '14 17:07 davisford

I'am joining the +1.

Even without the possibility to sort other columns (which I really like to keep), the issue is still not resolved with this idea. Just consider, that a group has more then "count" (in your case 50) entries and we are back at the problem, that the user sees "count" entries and thinks this is the whole group.

On the other hand I understand, that for many cases it wouldn't be nice, when the table expends to more then the predefined "count" entries (e.g. having good reasons to limit it to "count").

My idea for a solution to this issue would be some kind of visual differentiation in the "group header" between when all group items are listed and when not (e.g. the way it is now when all items listen, when not adding a "(...)" )

Marcel-Malus avatar Aug 14 '14 16:08 Marcel-Malus

:+1: facing the same issue here, ideally it would be great to have the groups paginate (similar to the subtotal concept) rather than the entire table.

mlabieniec avatar Feb 10 '16 16:02 mlabieniec

Review this issue #893

fsm3xpert avatar Aug 11 '16 18:08 fsm3xpert