mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Filter: parsed flag tweaks
* Set all true if `filter_useParsedData` true. * Stop using c.$headers
This commit is contained in:
parent
4e9905f26c
commit
06b190a520
@ -1176,18 +1176,17 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
// parse columns after formatter, in case the class is added at that point
|
// parse columns after formatter, in case the class is added at that point
|
||||||
data.parsed = c.$headers.map( function( columnIndex ) {
|
data.parsed = [];
|
||||||
return c.parsers && c.parsers[ columnIndex ] &&
|
for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
|
||||||
// force parsing if parser type is numeric
|
data.parsed[ columnIndex ] = wo.filter_useParsedData ||
|
||||||
c.parsers[ columnIndex ].parsed ||
|
// parser has a "parsed" parameter
|
||||||
// getData won't return 'parsed' if other 'filter-' class names exist
|
( 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"> )
|
// ( e.g. <th class="filter-select filter-parsed"> )
|
||||||
ts.getData && ts.getData( c.$headerIndexed[ columnIndex ],
|
ts.getData && ts.getData( c.$headerIndexed[ columnIndex ],
|
||||||
ts.getColumnData( table, c.headers, columnIndex ), 'filter' ) === 'parsed' ||
|
ts.getColumnData( table, c.headers, columnIndex ), 'filter' ) === 'parsed' ||
|
||||||
$( this ).hasClass( 'filter-parsed' );
|
c.$headerIndexed[ columnIndex ].hasClass( 'filter-parsed' ) );
|
||||||
}).get();
|
|
||||||
|
|
||||||
for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
|
|
||||||
vars.functions[ columnIndex ] =
|
vars.functions[ columnIndex ] =
|
||||||
ts.getColumnData( table, wo.filter_functions, columnIndex );
|
ts.getColumnData( table, wo.filter_functions, columnIndex );
|
||||||
vars.defaultColFilter[ columnIndex ] =
|
vars.defaultColFilter[ columnIndex ] =
|
||||||
|
@ -102,7 +102,7 @@ QUnit.extend(QUnit.assert, {
|
|||||||
});
|
});
|
||||||
// flatten array
|
// flatten array
|
||||||
flat = flat.concat.apply( flat, result.parsed );
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user