Skip to content

Commit

Permalink
fixed Uncaught TypeError: a.replace is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
vedmack committed May 14, 2016
1 parent 4c7b49f commit 924dfdf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
3 changes: 2 additions & 1 deletion ChangeLog.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
* Fixed destroy for multiple tables https://github.com/vedmack/yadcf/issues/293
* Allow selecting date and time (without closing filter) in date filtering https://github.com/vedmack/yadcf/issues/296
* Added global property - filters_tr_index: Allow to control the index of the <tr> inside the thead of the table, e.g when one <tr> is used for headers/sort and another <tr> is used for filters https://github.com/vedmack/yadcf/issues/297
* Some of additional closed issues https://github.com/vedmack/yadcf/issues/295 / https://github.com/vedmack/yadcf/issues/308
* Some of additional closed issues https://github.com/vedmack/yadcf/issues/295 / https://github.com/vedmack/yadcf/issues/308 / https://github.com/vedmack/yadcf/issues/314



## 0.8.9
Expand Down
18 changes: 15 additions & 3 deletions jquery.dataTables.yadcf.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Yet Another DataTables Column Filter - (yadcf)
*
* File: jquery.dataTables.yadcf.js
* Version: 0.9.0.beta.17 (grab latest stable from https://github.com/vedmack/yadcf/releases)
* Version: 0.9.0.beta.18 (grab latest stable from https://github.com/vedmack/yadcf/releases)
*
* Author: Daniel Reznick
* Info: https://github.com/vedmack/yadcf
Expand Down Expand Up @@ -2040,10 +2040,22 @@ var yadcf = (function ($) {
}

function sortAlphaNum(a, b) {
var aA = a.replace(reA, ""),
bA = b.replace(reA, ""),
var aA,
bA,
aN,
bN;

if (typeof a === 'string') {
aA = a.replace(reA, '');
} else if (typeof a === 'object' && typeof a.label === 'string') {
aA = a.label.replace(reA, '');
}
if (typeof b === 'string') {
bA = b.replace(reA, '');
} else if (typeof b === 'object' && typeof b.label === 'string') {
bA = b.label.replace(reA, '');
}

if (aA === bA) {
aN = parseInt(a.replace(reN, ""), 10);
bN = parseInt(b.replace(reN, ""), 10);
Expand Down

0 comments on commit 924dfdf

Please sign in to comment.