diff --git a/data/js/dataTables.alphabetSearch.min.js b/data/js/dataTables.alphabetSearch.min.js index f80332c7..8c52117c 100644 --- a/data/js/dataTables.alphabetSearch.min.js +++ b/data/js/dataTables.alphabetSearch.min.js @@ -8,7 +8,7 @@ $.fn.dataTable.ext.search.push(function(context, searchData) { if (!context.hasOwnProperty("alphabetSearch")) { return true; } if (!context.alphabetSearch.letterSearch) { return true; } var letter = searchData[context.alphabetSearch.column].toString() .replace(/<.*?>/g, "") .charAt(0) - .toUpperCase(); if (context.alphabetSearch.letterSearch !== "#") { if (letter === context.alphabetSearch.letterSearch) { return true; } } else { if (/\d/.test(letter)) { return true; } } return false; }); + .toUpperCase(); if (context.alphabetSearch.letterSearch !== "#") { if (letter === context.alphabetSearch.letterSearch) { return true; } } else { if (/[^a-zA-Z]/.test(letter)) { return true; } } return false; }); $.fn.dataTable.ext.order["alphabetSearch"] = function(context, col) { var order_col = this.api() .order()[0][0]; var order_method = this.api() .order()[0][1]; if (order_col !== context.alphabetSearch.column) { context.alphabetSearch.pass = 0; } var data = this.api() @@ -21,7 +21,7 @@ function bin(data) { var letter, bins = {}; for (var i = 0, ien = data.length; i < ien; i++) { letter = data[i].toString() .replace(/<.*?>/g, "") .charAt(0) - .toUpperCase(); if (/\d/.test(letter)) { letter = "#"; } if (bins[letter]) { bins[letter]++; } else { bins[letter] = 1; } } return bins; } + .toUpperCase(); if (/[^a-zA-Z]/.test(letter)) { letter = "#"; } if (bins[letter]) { bins[letter]++; } else { bins[letter] = 1; } } return bins; } function draw(table, alphabet, context) { alphabet.empty(); if (context.oLanguage.alphabetSearch.infoDisplay !== "") { $('') .html(context.oLanguage.alphabetSearch.infoDisplay)