mirror of
https://github.com/DataTables/DataTables.git
synced 2025-02-17 15:54:14 +01:00
Update: If there is no sorting methods for the column type, use string
- In the case of filtering, if there is no filtering extension for the column type, then the basic string based filter formatting is performed (i.e. string is always the fallback - there can't be an error because a function isn't there). - This commit matches that behaviour in sorting. If you define a column type as something for which there is no column sorting function, then the string type will be used rather than resulting in a javascript error.
This commit is contained in:
parent
42170f6498
commit
382482f8e9
@ -1 +1 @@
|
||||
f8646eb57de32debca88e1a6303b5dd94cd9ed58
|
||||
5f6a92db1e86a9bd89f2bd2247e8882dabc1b3d8
|
||||
|
5
media/js/jquery.dataTables.js
vendored
5
media/js/jquery.dataTables.js
vendored
@ -3988,7 +3988,7 @@
|
||||
// methods.
|
||||
displayMaster.sort( function ( a, b ) {
|
||||
var
|
||||
x, y, k, l, test, sort,
|
||||
x, y, k, l, test, sort, fn,
|
||||
len=aSort.length,
|
||||
dataA = aoData[a]._aSortData,
|
||||
dataB = aoData[b]._aSortData;
|
||||
@ -3999,7 +3999,8 @@
|
||||
x = dataA[ sort.col ];
|
||||
y = dataB[ sort.col ];
|
||||
|
||||
test = oExtSort[ sort.type+"-"+sort.dir ]( x, y );
|
||||
fn = oExtSort[ sort.type+"-"+sort.dir ] || oExtSort[ "string-"+sort.dir ];
|
||||
test = fn( x, y );
|
||||
if ( test !== 0 ) {
|
||||
return test;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user