Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Cloud.Friends.search order

$
0
0

Hi !

I've a simple question on ACS... :) I use this code to display a user's friends list :

Cloud.Friends.search({
    user_id : Ti.App.CurrentUser,
    per_page : 5,
    page : n
}...
And I would to get a list sorted on "first_name" field of "User" ACS object. I tried using the fields order on my query but it doesn't work and if I make a javascript sort with
function compare(a, b) {
    if (a.first_name < b.first_name)
        return -1;
    if (a.first_name > b.first_name)
        return 1;
    return 0;
}
friends.users.sort(compare);
the problem is that the sort is only done on the pagged list items...

So if someone has an idea... :)

Thank you in advance ! Hervé


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>