0

i am lookig at this post

jQuery each always sort it?

my situation is same, i am getting a json data from a query in a sorted structure

I tried the technique which is the last answer, but the sorting is never happening the way it is in json, jquery each is always sorting it from 1 to number of records, i want it to run it the way the json has it

134 - A
140 - B
131 - C

but the output is like this in jquery

131 - C
134 - A
140 - B
urrru
  • 3
  • 7
  • So you're aware the "last answer" doesn't mean anything, because you can sort the answers by active/oldest/votes. But unless your data can be provided as an array, I don't think you'll have much look as objects don't have an order – freefaller Jan 10 '20 at 16:00
  • Can you provide some data / code? It's not clear what you start with and which way you want it and, more importantly, why the way that gives you the correct answer is not the way you want to run it (instead it appears you want to run code that gives you an incorrect answer), *then* your title is you want it "unsorted" but provide an example of what you want where it *is* sorted and run a sort routine to return unsorted... see how it's confusing what you want? – freedomn-m Jan 10 '20 at 16:00
  • 1
    Be aware that if you mean [this answer](https://stackoverflow.com/a/38833513/7393478), it actually does not restore the original object's order, it sorts it based on the value behind the keys alphabetically. That's totally different. – Kaddath Jan 10 '20 at 16:02

0 Answers0