Ver Mensaje Individual
  #1 (permalink)  
Antiguo 03/02/2016, 08:49
jspcat
 
Fecha de Ingreso: junio-2005
Ubicación: Barcelona
Mensajes: 458
Antigüedad: 18 años, 10 meses
Puntos: 4
Table Sorter JQUERY

Holaa tod@s,

Tengo el siguiente problema con el plugin table sorter de jquery
Este es mi código

Código:
$(document).ready(function () {
        jQuery.tablesorter.addParser({
            id: "fancyNumber",
            is: function (s) {
                return /^[0-9]?[0-9,\.]*$/.test(s);
            },
            format: function (s) {
                return jQuery.tablesorter.formatFloat(s.replace(/./g, ''));
            },
            type: "numeric"
        });

        $("#mi-tabla").tablesorter({
            headers: { 0: { sorter: 'fancyNumber'} },
            widgets: ['zebra']
        });
    });
El problema es que ordena así

1.010.336 - 1.067.205 - 1.114 - 1.118.310

I deberia ser

1.114 - 1.010.336 - 1.067.205 - 1.118.310
o
1.118.310 - 1.067.205 - 1.010.336 - 1.114

Alguna idea?


Gracias!
__________________
La ficción es y será mi única realidad