There is a json line of the following form:
[ { "code":"NC", "name":"New Caledonia", "currency":"XPF", "name_translations":{ "de":"Neukaledonien", "en":"New Caledonia", "zh-CN":"新喀里多尼亚", "tr":"Yeni Kaledonya", "ru":"Новая Каледония", "fr":"Nouvelle-Calédonie", "es":"Nueva Caledonia", "it":"Nuova Caledonia", "th":"ประเทศนิวแคลิโดเนีย" } }, { "code":"MT", "name":"Malta", "currency":"EUR", "name_translations":{ "de":"Malta", "en":"Malta", "zh-CN":"马耳他", "tr":"Malta", "ru":"Мальта", "fr":"Malte", "es":"Malta", "it":"Malta", "th":"ประเทศมอลตา" } } ] And there is a script that loads the json file and adds each value to the list:
$.getJSON('/json/countries.json', function(data) { $.each(data, function(i, field){ $('#jelectTool1').jelect('addValue', field['code'], field['name_translations']['ru']); }); }); Question: Is it possible to sort them alphabetically before adding all the values to the list?