Filter: parsed flag tweaks

* Set all true if `filter_useParsedData` true.
* Stop using c.$headers
This commit is contained in:
Rob Garrison 2016-01-10 22:05:50 -06:00
parent 4e9905f26c
commit 06b190a520
2 changed files with 8 additions and 9 deletions

View File

@ -1176,18 +1176,17 @@
};
// parse columns after formatter, in case the class is added at that point
data.parsed = c.$headers.map( function( columnIndex ) {
return c.parsers && c.parsers[ columnIndex ] &&
// force parsing if parser type is numeric
c.parsers[ columnIndex ].parsed ||
// getData won't return 'parsed' if other 'filter-' class names exist
data.parsed = [];
for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
data.parsed[ columnIndex ] = wo.filter_useParsedData ||
// parser has a "parsed" parameter
( c.parsers && c.parsers[ columnIndex ] && c.parsers[ columnIndex ].parsed ||
// getData may not return 'parsed' if other 'filter-' class names exist
// ( e.g. <th class="filter-select filter-parsed"> )
ts.getData && ts.getData( c.$headerIndexed[ columnIndex ],
ts.getColumnData( table, c.headers, columnIndex ), 'filter' ) === 'parsed' ||
$( this ).hasClass( 'filter-parsed' );
}).get();
c.$headerIndexed[ columnIndex ].hasClass( 'filter-parsed' ) );
for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
vars.functions[ columnIndex ] =
ts.getColumnData( table, wo.filter_functions, columnIndex );
vars.defaultColFilter[ columnIndex ] =

View File

@ -102,7 +102,7 @@ QUnit.extend(QUnit.assert, {
});
// flatten array
flat = flat.concat.apply( flat, result.parsed );
QUnit.assert.deepEqual( flat, expected, 'testing parser cache: ' + txt);
QUnit.assert.deepEqual( flat, expected, 'Comparing parser cache: ' + txt);
}
});