I can't sort objects

[FONT=Verdana]
I can’t sort objects…

here I’m trying some examples [URL=“http://stackoverflow.com/questions/979256/sorting-an-array-of-javascript-objects”]from here,

none of them work… am trying to sort by id… no matter what method I use, the objects are not sorted… what am I missing…

thank you…
[/FONT]

Your object contains a property called h_id, you’re currently sorting by id which will parse to NaN resulting in a false return. Simply change a.id and b.id to a.h_id and b.h_id and it should work.

[FONT=Verdana]
oh my gosh… I don’t believe this…:blush:

thank you very much…

[/FONT]