Sort on multiple values #193

Closed
intelligence opened this Issue Dec 20, 2013 · 2 comments

3 participants

@intelligence

What's the best approach to sort on multiple values? I tried simply like this:
articleList.sort('title', { asc: true })
articleList.sort('category', { asc: true })

It behaves as it should in Safari and Firefox but in Chrome it doesn't..

@javve
Owner

List.js does not support sorting on multiple values at this time. I'm sorry. I may add this feature in the future, but not right now.

If your example works in some browsers it's just luck :)

However, in the latest version (1.1.0) I've added support for making your own sort function. Feel free to try something cool with that :) Ref: https://github.com/javve/list.js/blob/v1.1.0/test/test.sort.js#L260

@javve javve closed this Feb 3, 2014
@Mrbrand

I really would have great use of a custom sort function. Unfortunatly i don't understand these function templates. It would be soo nice to see a small example of an implementation. Just to get my head around this. Plz?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment