-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Allow or document use of Sortable events #11
Comments
Hi @logust , I would suggest that you watch directly the change events on the underlying Vm collection using vuejs watch API. This should cover the scenario you want to address. Please tell me if that would work for you and if not, please explain what you want to achieve. Thanks. |
Ah, of course. That approach is probably better anyway. I would maybe just add a bit in the documentation that says something like "Normally you would hook into Sortable events using the options, but instead you should use vue's watch API like so simple example here". Maybe not worth doing if I'm the only person who couldn't figure it out though :) |
Hi @logust , you are rigth: I will update the documentation and then close the issue. |
Documentation updated |
@David-Desmaisons I have an issue where I have 1 list that is in a bucket with a particular order , and the other that doesn't matter the order. So I need the ability to sort list1 when list1 changes. Which means i cannot use the watch method because it will have a loop. Ideas how to get around this? |
@lukepolo please open another issue with a jsfiddle descibing what you want to achieve and what is the problem. Thanks. |
Here is my jsfiddle https://jsfiddle.net/jyf2fuwj/4/ Im trying to make sure the list 1 is in the proper order |
You can use |
No sorry ill try to explain it better. Each entry in my list has a property called When someone drags from a item from |
Also |
Here: |
Ah your awesome thank you |
I'm trying to set up my Sortable options like so:
sortableOptions: { draggable : ".list-item", onUpdate : function() { console.log('updated!'); } }
The onUpdate doesn't trigger though, since your version of the function overrides it during your _merge.
Is there a different way you suggest me hooking into that event so that I can also use it to execute some code? Or can it be updated to call your function, then the one passed through in an option?
Thanks!
The text was updated successfully, but these errors were encountered: