Filter: keep parent match when no child rows match. See #1020

This commit is contained in:
Mottie 2015-09-23 22:46:03 -05:00
parent f7b9e1f914
commit 0ebb9ea219
8 changed files with 35 additions and 15 deletions

View File

@ -3835,7 +3835,7 @@
return; return;
} }
var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex, var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
isChild, childRow, lastSearch, showRow, time, val, indx, isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
notFiltered, searchFiltered, query, injected, res, id, txt, notFiltered, searchFiltered, query, injected, res, id, txt,
storedFilters = $.extend( [], filters ), storedFilters = $.extend( [], filters ),
regex = tsf.regex, regex = tsf.regex,
@ -4023,7 +4023,9 @@
} }
showRow = false; showRow = false;
val = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
// don't pass reference to val
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_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
@ -4044,6 +4046,8 @@
} }
} }
} }
// keep parent row match even if no child matches... see #1020
showRow = showRow || showParent;
} else { } else {
showRow = val; showRow = val;
} }

File diff suppressed because one or more lines are too long

View File

@ -1491,7 +1491,7 @@
return; return;
} }
var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex, var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
isChild, childRow, lastSearch, showRow, time, val, indx, isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
notFiltered, searchFiltered, query, injected, res, id, txt, notFiltered, searchFiltered, query, injected, res, id, txt,
storedFilters = $.extend( [], filters ), storedFilters = $.extend( [], filters ),
regex = tsf.regex, regex = tsf.regex,
@ -1679,7 +1679,9 @@
} }
showRow = false; showRow = false;
val = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
// don't pass reference to val
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_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
@ -1700,6 +1702,8 @@
} }
} }
} }
// keep parent row match even if no child matches... see #1020
showRow = showRow || showParent;
} else { } else {
showRow = val; showRow = val;
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -3841,7 +3841,7 @@
return; return;
} }
var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex, var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
isChild, childRow, lastSearch, showRow, time, val, indx, isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
notFiltered, searchFiltered, query, injected, res, id, txt, notFiltered, searchFiltered, query, injected, res, id, txt,
storedFilters = $.extend( [], filters ), storedFilters = $.extend( [], filters ),
regex = tsf.regex, regex = tsf.regex,
@ -4029,7 +4029,9 @@
} }
showRow = false; showRow = false;
val = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
// don't pass reference to val
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_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
@ -4050,6 +4052,8 @@
} }
} }
} }
// keep parent row match even if no child matches... see #1020
showRow = showRow || showParent;
} else { } else {
showRow = val; showRow = val;
} }

View File

@ -1497,7 +1497,7 @@
return; return;
} }
var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex, var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
isChild, childRow, lastSearch, showRow, time, val, indx, isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
notFiltered, searchFiltered, query, injected, res, id, txt, notFiltered, searchFiltered, query, injected, res, id, txt,
storedFilters = $.extend( [], filters ), storedFilters = $.extend( [], filters ),
regex = tsf.regex, regex = tsf.regex,
@ -1685,7 +1685,9 @@
} }
showRow = false; showRow = false;
val = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
// don't pass reference to val
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_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
@ -1706,6 +1708,8 @@
} }
} }
} }
// keep parent row match even if no child matches... see #1020
showRow = showRow || showParent;
} else { } else {
showRow = val; showRow = val;
} }

View File

@ -1123,7 +1123,7 @@
return; return;
} }
var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex, var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
isChild, childRow, lastSearch, showRow, time, val, indx, isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
notFiltered, searchFiltered, query, injected, res, id, txt, notFiltered, searchFiltered, query, injected, res, id, txt,
storedFilters = $.extend( [], filters ), storedFilters = $.extend( [], filters ),
regex = tsf.regex, regex = tsf.regex,
@ -1311,7 +1311,9 @@
} }
showRow = false; showRow = false;
val = tsf.processRow( c, data, vars ); showParent = tsf.processRow( c, data, vars );
// don't pass reference to val
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_childWithSibs ) { if ( !wo.filter_childWithSibs ) {
@ -1332,6 +1334,8 @@
} }
} }
} }
// keep parent row match even if no child matches... see #1020
showRow = showRow || showParent;
} else { } else {
showRow = val; showRow = val;
} }