1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| $(document).ready(function() {
// call the tablesorter plugin, the magic happens in the markup
$("#annonces").tablesorter(
{headers: {
11: {sorter:'tarif'}
}
});
});
// add parser through the tablesorter addParser method
$.tablesorter.addParser(
{
// set a unique id
id: 'tarif',
is: function(s) {
// return false so this parser is not auto detected
return false;
},
format: function(s) {
// format your data for normalization
var r = s.toLowerCase().replace(/ /,'').replace(/ /,'');
//alert("avant : "+s+" après : "+r);
return r;
},
// set type, either numeric or text
type: 'numeric'
}
); |