Grouping: prevent JS error with ajax & filtering. Fixes #1232

This commit is contained in:
Rob Garrison 2016-06-21 11:39:36 -05:00
parent 7d16a2e4f6
commit eb80800d2b
No known key found for this signature in database
GPG Key ID: 0A42D160D71978E1
2 changed files with 8 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -209,10 +209,13 @@
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;
// fixes #438
if ( data.$row.is( ':visible' ) && tsg.types[ data.grouping[ 1 ] ] ) {
tsg.insertGroupHeader( c, wo, data );
// fixes #1232 - ajax issue; if endRow > norm_rows.length (after filtering), then data.rowData is undefined
if (data.rowData) {
data.$row = data.rowData[ c.columns ].$row;
// fixes #438
if ( data.$row.is( ':visible' ) && tsg.types[ data.grouping[ 1 ] ] ) {
tsg.insertGroupHeader( c, wo, data );
}
}
}
}