Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort #20

Open
sfxworks opened this issue Jun 21, 2017 · 1 comment
Open

Sort #20

sfxworks opened this issue Jun 21, 2017 · 1 comment

Comments

@sfxworks
Copy link

Do all of these methods work?
https://firebase.google.com/docs/database/rest/retrieve-data

I am trying to order my data alphabetically. After I turn my data into an Object I can't turn it into an array and sort it.

var sorted:Array = e.data //JSON.parse result
sorted.sortOn("1");

I saw that REST isn't able to keep list items at order either. I want to sort all the items I get from a JSON node alphanumerically.

@agentphantom
Copy link
Member

You are correct, Firebase always returns the data scrambled and you are required to sort it in client side.

Please take a look at this function, it shows you how you can recursively convert the JSON into an Array, sort it and pass it to a data provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants