Grouping: Use correct pager row indexing. Fixes #1232

This commit is contained in:
Rob Garrison 2016-06-20 11:32:02 -05:00
parent e313cdea41
commit a1413a6015
No known key found for this signature in database
GPG Key ID: 0A42D160D71978E1
2 changed files with 5 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -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;