You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 8, 2020. It is now read-only.
orderBy filter causes wrong item to be dragged #70
Using orderBy such as player in players | orderBy: 'first_name' causes the wrong item to be dragged between two lists. It appears the ui-sortable list is based off of index, prior to sorting.
I started to create a plunker example outside of my project, but it's not quite working, so it's not very useful. I'm experiencing this issue when 2 or more lists are connected and list items are dragged between the two.
How interesting. Up to this point we haven't supported orderBy because we looked at from the perspective of a single list. In that case sortable would have no idea how to change the item to reorder them. In your example, what should it do, change the first letter of the two names, swap the names?
However, I never though about using sortable not to reorder items, but simply to drag them between lists. In which case, orderBy makes sense again.
Now the question becomes whether this should be supported by ui-sortable, or a new, much simpler library.
Essentially all I'm trying to do is drag items between lists, but also
maintain a specific order in the process.
For example, my objective is for both lists to maintain an order by the
player's grade. So if I drag a 7th grader to the top of a list where there
is a 10th grader, it sorts the players correctly as:
How interesting. Up to this point we haven't supported orderBy because we
looked at from the perspective of a single list. In that case sortable
would have no idea how to change the item to reorder them. In your example,
what should it do, change the first letter of the two names, swap the
names?
However, I never though about using sortable not to reorder items, but
simply to drag them between lists. In which case, orderBy makes sense
again.
Now the question becomes whether this should be supported by ui-sortable,
or a new, much simpler library.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/70#issuecomment-29759758
.
Yeah, that makes a lot of sense. Sounds like a perfect use case to me. I don't have time to look at this right now, but hopefully within the next week or two I will. If you want, you can start on a pull-request yourself.
Yeah, that makes a lot of sense. Sounds like a perfect use case to me. I
don't have time to look at this right now, but hopefully within the next
week or two I will. If you want, you can start on a pull-request yourself.
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/70#issuecomment-29760170
.
Activity
CyborgMaster commentedon Dec 3, 2013
How interesting. Up to this point we haven't supported
orderBybecause we looked at from the perspective of a single list. In that case sortable would have no idea how to change the item to reorder them. In your example, what should it do, change the first letter of the two names, swap the names?However, I never though about using sortable not to reorder items, but simply to drag them between lists. In which case,
orderBymakes sense again.Now the question becomes whether this should be supported by ui-sortable, or a new, much simpler library.
bkuhl commentedon Dec 3, 2013
Essentially all I'm trying to do is drag items between lists, but also
maintain a specific order in the process.
For example, my objective is for both lists to maintain an order by the
player's grade. So if I drag a 7th grader to the top of a list where there
is a 10th grader, it sorts the players correctly as:
On Tue, Dec 3, 2013 at 5:46 PM, CyborgMaster notifications@github.comwrote:
Ben Kuhl
CyborgMaster commentedon Dec 3, 2013
Yeah, that makes a lot of sense. Sounds like a perfect use case to me. I don't have time to look at this right now, but hopefully within the next week or two I will. If you want, you can start on a pull-request yourself.
bkuhl commentedon Dec 3, 2013
If I get the chance to, I will.
On Tue, Dec 3, 2013 at 5:51 PM, CyborgMaster notifications@github.comwrote:
Ben Kuhl
thgreasi commentedon Jan 5, 2014
@bkuhl Here is an edited version of your plunk. Please verify that this works as intended, since I didn't have much time.
As already descussed in other issues
Always prefer applying filters in the controller instead of the 'view'.
This is:
Please reopen if applicable.
bkuhl commentedon Jan 5, 2014
Yep, that's the functionality I was looking for... thanks!!