Skip to content

Commit

Permalink
Grouping: Use correct pager row indexing. Fixes #1232
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Jun 20, 2016
1 parent e313cde commit a1413a6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/js/widgets/widget-grouping.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions js/widgets/widget-grouping.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,14 @@
},
findColumnGroups : function( c, wo, data ) {
var tbodyIndex, norm_rows, $row, rowIndex, end, undef,
hasPager = ts.hasWidget( c.table, 'pager' );
hasPager = ts.hasWidget( c.table, 'pager' ),
p = c.pager || {};
data.groupIndex = 0;
for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
norm_rows = c.cache[ tbodyIndex ].normalized;
data.group = undef; // clear grouping across tbodies
rowIndex = hasPager ? c.pager.startRow - 1 : 0;
end = hasPager ? c.pager.endRow : norm_rows.length;
rowIndex = hasPager && !p.ajax ? p.startRow - 1 : 0;
end = hasPager ? p.endRow - ( p.ajax ? p.startRow : 0 ): norm_rows.length;
for ( ; rowIndex < end; rowIndex++ ) {
data.rowData = norm_rows[ rowIndex ];
data.$row = data.rowData[ c.columns ].$row;
Expand Down

0 comments on commit a1413a6

Please sign in to comment.