diff --git a/js/DataTables.js b/js/DataTables.js index f4afa7e1d..c9f6cc00a 100644 --- a/js/DataTables.js +++ b/js/DataTables.js @@ -200,9 +200,9 @@ require('ext.js'); require('ext.classes.js'); require('ext.paging.js'); - require('ext.sorting.js'); require('ext.types.js'); require('ext.filter.js'); + require('ext.sorting.js'); require('ext.renderer.js'); require('ext.helpers.js'); require('api.internal.js'); diff --git a/js/ext/ext.filter.js b/js/ext/ext.filter.js index 868e47171..aaefe4c63 100644 --- a/js/ext/ext.filter.js +++ b/js/ext/ext.filter.js @@ -2,6 +2,10 @@ // Filter formatting functions. See model.ext.ofnSearch for information about // what is required from these methods. +// +// Note that additional search methods are added for the html numbers and +// html formatted numbers by `_addNumericSort()` when we know what the decimal +// place is $.extend( DataTable.ext.type.search, { diff --git a/js/ext/ext.sorting.js b/js/ext/ext.sorting.js index 495190796..9e9d43ff9 100644 --- a/js/ext/ext.sorting.js +++ b/js/ext/ext.sorting.js @@ -26,8 +26,8 @@ var __numericReplace = function ( d, decimalPlace, re1, re2 ) { }; -// Add the numeric 'deformatting' functions for sorting. This is done in a -// function to provide an easy ability for the language options to add +// Add the numeric 'deformatting' functions for sorting and search. This is done +// in a function to provide an easy ability for the language options to add // additional methods if a non-period decimal place is used. function _addNumericSort ( decimalPlace ) { $.each( @@ -53,7 +53,13 @@ function _addNumericSort ( decimalPlace ) { } }, function ( key, fn ) { + // Add the ordering method _ext.type.order[ key+decimalPlace+'-pre' ] = fn; + + // For HTML types add a search formatter that will strip the HTML + if ( key.match(/^html\-/) ) { + _ext.type.search[ key+decimalPlace ] = _ext.type.search.html; + } } ); }