This question has already been answered:
I can’t sort the resulting list by 2 fields: NAME and LASTNAME.
Sorting is by NAME only.
How can I fix the situation?
Thank.
// Сортировка значений response.features.sort(function (a, b) { if (a.attributes["NAME"] && b.attributes["NAME"]) { return (a.attributes["NAME"] > b.attributes["NAME"]) ? 1 : -1; } else if (a.attributes["NAME"]) { return -1; } else if (b.attributes["NAME"]) { return 1; } return (a.attributes["LASTNAME"] > b.attributes["LASTNAME"]) ? 1 : -1; });