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 ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -4015,7 +4015,7 @@
// a match anywhere in the child row, then it will make the row visible
// checked here so the option can be changed dynamically
for ( indx = 0; indx < childRow.length; indx++ ) {
txt += ' ' + childRow[indx].join( '' ) || '';
txt += ' ' + childRow[indx].join( ' ' ) || '';
}
data.childRowText = wo.filter_childRows ?
( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
@ -4024,15 +4024,19 @@
showRow = false;
showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val
val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
}
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
}
// cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx );
@ -4051,11 +4055,6 @@
} else {
showRow = val;
}
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row
.toggleClass( wo.filter_filteredRow, !showRow )[0]
.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 ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -1671,7 +1671,7 @@
// a match anywhere in the child row, then it will make the row visible
// checked here so the option can be changed dynamically
for ( indx = 0; indx < childRow.length; indx++ ) {
txt += ' ' + childRow[indx].join( '' ) || '';
txt += ' ' + childRow[indx].join( ' ' ) || '';
}
data.childRowText = wo.filter_childRows ?
( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
@ -1680,15 +1680,19 @@
showRow = false;
showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val
val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
}
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
}
// cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx );
@ -1707,11 +1711,6 @@
} else {
showRow = val;
}
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row
.toggleClass( wo.filter_filteredRow, !showRow )[0]
.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 ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -4021,7 +4021,7 @@
// a match anywhere in the child row, then it will make the row visible
// checked here so the option can be changed dynamically
for ( indx = 0; indx < childRow.length; indx++ ) {
txt += ' ' + childRow[indx].join( '' ) || '';
txt += ' ' + childRow[indx].join( ' ' ) || '';
}
data.childRowText = wo.filter_childRows ?
( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
@ -4030,15 +4030,19 @@
showRow = false;
showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val
val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
}
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
}
// cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx );
@ -4057,11 +4061,6 @@
} else {
showRow = val;
}
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row
.toggleClass( wo.filter_filteredRow, !showRow )[0]
.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 ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -1677,7 +1677,7 @@
// a match anywhere in the child row, then it will make the row visible
// checked here so the option can be changed dynamically
for ( indx = 0; indx < childRow.length; indx++ ) {
txt += ' ' + childRow[indx].join( '' ) || '';
txt += ' ' + childRow[indx].join( ' ' ) || '';
}
data.childRowText = wo.filter_childRows ?
( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
@ -1686,15 +1686,19 @@
showRow = false;
showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val
val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
}
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
}
// cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx );
@ -1713,11 +1717,6 @@
} else {
showRow = val;
}
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row
.toggleClass( wo.filter_filteredRow, !showRow )[0]
.display = showRow ? '' : 'none';

View File

@ -1303,7 +1303,7 @@
// a match anywhere in the child row, then it will make the row visible
// checked here so the option can be changed dynamically
for ( indx = 0; indx < childRow.length; indx++ ) {
txt += ' ' + childRow[indx].join( '' ) || '';
txt += ' ' + childRow[indx].join( ' ' ) || '';
}
data.childRowText = wo.filter_childRows ?
( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
@ -1312,15 +1312,19 @@
showRow = false;
showParent = tsf.processRow( c, data, vars );
$row = rowData.$row;
// don't pass reference to val
val = showParent ? true : false;
childRow = rowData.$row.filter( ':gt( 0 )' );
if ( wo.filter_childRows && childRow.length ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
}
if ( wo.filter_childByColumn ) {
if ( !wo.filter_childWithSibs ) {
// hide all child rows
childRow.addClass( wo.filter_filteredRow );
// if only showing resulting child row, only include parent
$row = $row.eq( 0 );
}
// cycle through each child row
for ( indx = 0; indx < childRow.length; indx++ ) {
data.$row = childRow.eq( indx );
@ -1339,11 +1343,6 @@
} else {
showRow = val;
}
$row = rowData.$row;
// if only showing resulting child row, only include parent
if ( !wo.filter_childWithSibs ) {
$row = $row.eq( 0 );
}
$row
.toggleClass( wo.filter_filteredRow, !showRow )[0]
.display = showRow ? '' : 'none';