Filter: ignore childWithSibs when childByColumn is false. See #1020

Also fixed data.childRowText by adding spaces between cell content
This commit is contained in:
Mottie 2015-09-24 08:49:17 -05:00
parent ecb2fa47c3
commit e23288cee8
8 changed files with 55 additions and 60 deletions

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 09-23-2015 (v2.23.4)*/ /*! tablesorter (FORK) - updated 09-24-2015 (v2.23.4)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -4024,15 +4024,19 @@
showRow = false; showRow = false;
showParent = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val // don't pass reference to val
val = showParent ? true : false; val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' ); childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) { if ( wo.filter_childRows && childRow.length ) {
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
// hide all child rows // hide all child rows
childRow.addClass( wo.filter_filteredRow ); childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
} }
if ( wo.filter_childByColumn ) {
// cycle through each child row // cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) { for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx ); data.$row = childRow.eq( indx );
@ -4051,11 +4055,6 @@
} else { } else {
showRow = val; showRow = val;
} }
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row $row
.toggleClass( wo.filter_filteredRow, !showRow )[0] .toggleClass( wo.filter_filteredRow, !showRow )[0]
.display = showRow ? '' : 'none'; .display = showRow ? '' : 'none';

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 09-23-2015 (v2.23.4)*/ /*! tablesorter (FORK) - updated 09-24-2015 (v2.23.4)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -1680,15 +1680,19 @@
showRow = false; showRow = false;
showParent = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val // don't pass reference to val
val = showParent ? true : false; val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' ); childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) { if ( wo.filter_childRows && childRow.length ) {
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
// hide all child rows // hide all child rows
childRow.addClass( wo.filter_filteredRow ); childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
} }
if ( wo.filter_childByColumn ) {
// cycle through each child row // cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) { for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx ); data.$row = childRow.eq( indx );
@ -1707,11 +1711,6 @@
} else { } else {
showRow = val; showRow = val;
} }
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row $row
.toggleClass( wo.filter_filteredRow, !showRow )[0] .toggleClass( wo.filter_filteredRow, !showRow )[0]
.display = showRow ? '' : 'none'; .display = showRow ? '' : 'none';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 09-23-2015 (v2.23.4)*/ /*! tablesorter (FORK) - updated 09-24-2015 (v2.23.4)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -4030,15 +4030,19 @@
showRow = false; showRow = false;
showParent = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val // don't pass reference to val
val = showParent ? true : false; val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' ); childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) { if ( wo.filter_childRows && childRow.length ) {
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
// hide all child rows // hide all child rows
childRow.addClass( wo.filter_filteredRow ); childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
} }
if ( wo.filter_childByColumn ) {
// cycle through each child row // cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) { for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx ); data.$row = childRow.eq( indx );
@ -4057,11 +4061,6 @@
} else { } else {
showRow = val; showRow = val;
} }
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row $row
.toggleClass( wo.filter_filteredRow, !showRow )[0] .toggleClass( wo.filter_filteredRow, !showRow )[0]
.display = showRow ? '' : 'none'; .display = showRow ? '' : 'none';

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 09-23-2015 (v2.23.4)*/ /*! tablesorter (FORK) - updated 09-24-2015 (v2.23.4)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -1686,15 +1686,19 @@
showRow = false; showRow = false;
showParent = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val // don't pass reference to val
val = showParent ? true : false; val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' ); childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) { if ( wo.filter_childRows && childRow.length ) {
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
// hide all child rows // hide all child rows
childRow.addClass( wo.filter_filteredRow ); childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
} }
if ( wo.filter_childByColumn ) {
// cycle through each child row // cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) { for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx ); data.$row = childRow.eq( indx );
@ -1713,11 +1717,6 @@
} else { } else {
showRow = val; showRow = val;
} }
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row $row
.toggleClass( wo.filter_filteredRow, !showRow )[0] .toggleClass( wo.filter_filteredRow, !showRow )[0]
.display = showRow ? '' : 'none'; .display = showRow ? '' : 'none';

View File

@ -1312,15 +1312,19 @@
showRow = false; showRow = false;
showParent = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val // don't pass reference to val
val = showParent ? true : false; val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' ); childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) { if ( wo.filter_childRows && childRow.length ) {
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
// hide all child rows // hide all child rows
childRow.addClass( wo.filter_filteredRow ); childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
} }
if ( wo.filter_childByColumn ) {
// cycle through each child row // cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) { for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx ); data.$row = childRow.eq( indx );
@ -1339,11 +1343,6 @@
} else { } else {
showRow = val; showRow = val;
} }
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row $row
.toggleClass( wo.filter_filteredRow, !showRow )[0] .toggleClass( wo.filter_filteredRow, !showRow )[0]
.display = showRow ? '' : 'none'; .display = showRow ? '' : 'none';