Skip to content

Ember.SortableMixin: Add support of custom sortFunction - #1194

Closed
sly7-7 wants to merge 4 commits into
emberjs:masterfrom
sly7-7:routable-custom-sort
Closed

sly7-7 wants to merge 4 commits into
emberjs:masterfrom
sly7-7:routable-custom-sort

Conversation

@sly7-7

@sly7-7 sly7-7 commented Jul 20, 2012

Copy link
Copy Markdown
Contributor

The default sorting algorithm used in the Routable mixin (based on Ember.compare) was not satisfying in our case.
For example we want 'a' to appear before 'B' (in ascending order)

I think this PR is not complete as we have to handle each type of sortProperties.

@travisbot

Copy link
Copy Markdown

This pull request passes (merged 5ab6398 into 2d9f107).

@wagenet

wagenet commented Jul 21, 2012

Copy link
Copy Markdown
Member

@sly7-7 So what do you want to add to make this complete?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wagenet Perhaps I would add the current sortProperty (or its type) as a third argument, in order to make the implementation easier.
The other way could be to have a sort function by sort property. I don't know what way would be better, or if it good enough like this. Your advices would be welcome :)

@travisbot

Copy link
Copy Markdown

This pull request passes (merged bb3c3e9 into 68642d9).

@sly7-7

sly7-7 commented Jul 23, 2012

Copy link
Copy Markdown
Contributor Author

Hmm, sorry, I just begin to use git/github, and I've probably made something wrong when I wanted to update against upstream/master... If necessary, I will create again the branch and post a new PR.
Please let me know what am I suppose to do.

@wagenet

wagenet commented Jul 25, 2012

Copy link
Copy Markdown
Member

For PRs, it's best to do a git rebase master then git push -f to your branch.

@sly7-7

sly7-7 commented Jul 25, 2012

Copy link
Copy Markdown
Contributor Author

Thanks for the tip :)

Now two things: Do I close this PR and create an other one ? For the functional parts, it seems that I'm the only one who needs this kind of stuff. So perhaps it's simply not usefull and have to make this stuff only in our app.

@wagenet

wagenet commented Jul 25, 2012

Copy link
Copy Markdown
Member

@sly7-7 I think this could still be useful. If you do the rebase as I suggested earlier then you can still fix this branch.

@sly7-7

sly7-7 commented Jul 25, 2012

Copy link
Copy Markdown
Contributor Author

Ok, no problem, I will cleanup the branch, and perhaps define a new api for this feature.

@travisbot

Copy link
Copy Markdown

This pull request passes (merged 52877e3 into 6851158).

@sly7-7

sly7-7 commented Jul 25, 2012

Copy link
Copy Markdown
Contributor Author

I apologize, seems wrong. I will close this PR, delete the branch, create a new one, and create a new PR.

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

Successfully merging this pull request may close these issues.

3 participants