4
Have to maintain the order of the items that came in JSON
of a API
?
This is like this coming from API
:
{"6":"Abadia","218":"Abel Reis","44":"Alexandre Campos - Jardim","13":"Alfredo Freire I","174":"Alfredo Freire II","186":"Alfredo Freire III","217":"Alfredo Freire IV","189":"Alvorada I, Jardim","190":"Alvorada II, Jardim","55":"Am\u00e9rica - Jardim","80":"Amoroso Costa","254":"Anita, Jardim","137":"Antonia"}
and when I wear it on select
for example the JSON
this being organized by index
and not by texto
, that is, staying like this:
1: "Centre"
2: "Saint Benedict"
3: "Santa Maria"
6: "Abbey"
8: "Great Horizon"
9: "Boa Vista"
10: "Mercy"
11: "Rec. of Bandeirantes"
Check if API can be ordered in Javascript
– novic
The object is in alphabetical order and you want to keep so in select is this?
– LeAndrade
@Virgilionovic friend the API is sending already organized. The problem is in Javascript that is organizing by the index. Being that the right is organized by the text and not by the index.
– Joao Nivaldo
@Leandro this same. I want to keep the alphabetical order of the values and not the numeric of the index.
– Joao Nivaldo