私はJavascriptでこのオブジェクトを持っています:
[
{
"id": "60001",
"name": "NORTH COLORADO MEDICAL CENTER",
"friendly_name": "Kidney Failure - w/o CC MCC",
"address": "1801 16TH STREET",
"state": "CO",
"zip": "80631",
"service_count": "14",
"charges": "18,381",
"payments": "4,339",
"distance": "49.920"
},
{
"id": "60031",
"name": "CENTURA HEALTH-PENROSE ST FRANCIS HEALTH SERVICES",
"friendly_name": "Kidney Failure - w/o CC MCC",
"address": "2222 N NEVADA AVE",
"state": "CO",
"zip": "80907",
"service_count": "21",
"charges": "18,512",
"payments": "3,801",
"distance": "60.961"
}
]
デフォルトでは、オブジェクトは「id」順に並べられます。そのオブジェクトをそのままにして、「id」ではなくフィールド「name」で昇順に並べ替えたいと思います。以下をチェックして、結果をどのように表示したいかを確認してください。
[
{
"id": "60031",
"name": "CENTURA HEALTH-PENROSE ST FRANCIS HEALTH SERVICES",
"friendly_name": "Kidney Failure - w/o CC MCC",
"address": "2222 N NEVADA AVE",
"state": "CO",
"zip": "80907",
"service_count": "21",
"charges": "18,512",
"payments": "3,801",
"distance": "60.961"
},
{
"id": "60001",
"name": "NORTH COLORADO MEDICAL CENTER",
"friendly_name": "Kidney Failure - w/o CC MCC",
"address": "1801 16TH STREET",
"state": "CO",
"zip": "80631",
"service_count": "14",
"charges": "18,381",
"payments": "4,339",
"distance": "49.920"
}
]