1

I'm trying to make a custom sort function for my dynatable to sort integers correctly but it seems I'm missing something, here's my sort function :

function intSort(a, b , attr, direction) {

    var inta = parseInt(a.nombre);
    var intb = parseInt(b.nombre);
    var ret = (inta < intb) ? -1 : ((inta > intb) ?  1 : 0);
    return ret;
}

here's the fiddle, as you can see sorting doesn't work on column "Nombre"

florian.isopp
  • 834
  • 2
  • 12
  • 36

1 Answers1

1

Ok, It works now, what I've done is declare this reader for my column :

readers:{
    nombre : function(el, record){
        return parseInt(el.innerHTML);
    }
}