Implement the sort() function in $$


#1

Hi,
I can implement the sort() function in $$?

I have to order a

  • via a date attribute.

    I get an error using sort():
    $$(".vicinoList li").sort(sort_li).appendTo(’.vicinoList’);

    Do you have ideas on how to solve it?

    Thank you!


  • #2

    There is no such method in Dom7


    #3

    No, it doesn’t exist, but I’ve solved it this way:
    list.sort(function (a, b) {
    return a.distanza - b.distanza;
    });

    Thank you.