-
Notifications
You must be signed in to change notification settings - Fork 575
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
dragdrop doesn't play nicely with jQuery UI's sortable #37
Comments
Can I see small demo of what you are trying to do? |
Happening to me as well. Not clear why it's not working as I don't use jQueryUI's sortable at the moment, and in my case is dying at line 173 of angular-dragdrop.js. I'm using jqyoui-draggable and jqyoui-droppable on the same elements and I'm not using an ng-model on these elements. Console shows: Error: Syntax Error: Token '=' implies assignment but [undefined ] can not be assigned to at column 11 of the expression [undefined = __dropItem] starting at [= __dropItem]. |
ngModel on draggable/droppable is mandatory to make swapping happen. |
Ok. I didn't want swapping or model-integration, so I wasn't using it. The idea was to just create a link between two elements by dragging on top of another. Ended up just defining my own very simple directives based on jQueryUI's draggable and droppable. |
Oh, now I got it. I'll consider this scenario to be fixed soon. On Thu, Aug 15, 2013 at 10:39 PM, Ethan Jewett notifications@github.comwrote:
With Regards *Q: Why is this email five sentences or less? |
Hey codef0rmer, How can you get a list where the elements can be dragged out of the list and sortable within the list? I have tried to add the ui-sortable to a div that accepts the droppable but it is not working to sort.
However without the drag and drop code the ui-sortable code works fine
Please let me know if there are some options that I am missing, or if these two don't play nicely together |
I'm not sure both will work together but why you want to use both? |
I am looking to be able to exchange items between two lists, and be able to sort the order in in at least one of the lists. Please let me know if you know of a way to get these to work together as currently the ui-sortable does not work with it. Thanks |
Fine. You create two lists with some items and let items drag from list1 to list2 (check out http://codef0rmer.github.io/angular-dragdrop/#/list) and i assume that after each item is dropped, you want to sort all items from list1 by name or something (try this http://codef0rmer.github.io/angular-dragdrop/#/filter). You need to combine above 2 demos into one. Try and let me know in case of any issue. |
I am not looking to sort by name or filter to sort on a variable, the order needs to be completely adjustable as dragged to specify the order, as the final product is not a list of names but of forms of varying sizes. Thanks |
What problem you face when you combine both ui-sortable and angular-dragdrop? I would like to fix the issue from my end? A small working demo would be very helpful to gain some insight. Thanks! |
Here is a Plunker of what I am dealing with, I attempted to get ui-sortable to work on the second div but with no success |
Hi, |
@unnamedyoyo can you share a demo as @slreynol demo does not help me understand the problem? |
@codef0rmer We can see that ui-sortable is not working with angular-dragdrop, we can't sort the list on the right: If we remove all the angular-dragdrop attributes ("data-drag", "data-jqyoui-options", "ng-model" and "jqyoui-draggable"), ui-sortable is working, but not angular-dragdrop (obviously): If we only remove the "data-drag" attribute, everything is working, but the animation become weird, if we drop the items on this list on the left: The animation problem can be overcome with "animate:false", but that doesn't really solve the problem. And, I don't know the consequences if I remove "data-drag". |
I wish to have them work together well but may be the events are http://jsfiddle.net/codef0rmer/ey87K/4/ On Mon, Oct 21, 2013 at 4:56 PM, unnamedyoyo notifications@github.comwrote:
With Regards *Q: Why is this email five sentences or less? |
FYI I added two buttons to enable/disable this two behaviors. A good solutions will be use a native angular d&d. I did it and worked. |
Glad to know. BTW, which native DND have you used? angular-dragondrop? On Mon, Oct 21, 2013 at 10:38 PM, icemancml notifications@github.comwrote:
With Regards *Q: Why is this email five sentences or less? |
http://blog.parkji.co.uk/2013/08/11/native-drag-and-drop-in-angularjs.html. It´s very simple but usefull. |
Interesting I'll try to incorporate this approach in my plugin and allow On Mon, Oct 21, 2013 at 10:59 PM, icemancml notifications@github.comwrote:
With Regards *Q: Why is this email five sentences or less? |
@codef0rmer Thank you for your help, but I need to have the same handler for sortable and draggable. So for now, I'll probably won't use ui-sortable and try to sort/drag/drop with the solution which will work first, in that order:
Thank you both. |
Is there any update, on this issue? I would still like to use ui-sortable and be able to drag an object to a separate list and have them work together. Does anyone have a working demo of this? |
No development yet on this but I'll spend some time next week to give it some thought. Stay Tuned! |
Is there an update on this issue? Im also intrested in using this drag and drop with ui-sortable. |
+1 |
Same here. Any updates? |
Sorry for waiting you guys, little busy these days. I hope to fix it soon. |
Also interested in seeing this issue resolved. |
Hello, any news regarding this? |
@orszaczky: Nope, sorry but I'm quite busy with my book and could not get time to spend on it. Would you like to give it a try? |
Hey everyone, If you don't need any of the jqyoui-draggable options, you can sort items between two lists and their corresponding ng-models by tweaking some of the settings:
I imagine this removes the draggable callbacks that were conflicting with the sortable callbacks. Works alright for me - will see if I run into any problems down the line |
Hi everyone, I also have this problem. It has been quite a while since the last comment here...is there a fix or a workaround anyone could share? Thanks! |
Hi,
Firstly thank you for writing this drag drop directive. I have two columns, one is draggable, the other droppable. The droppable column is also sortable using jQuery UI but when trying to sort, a droppable event is triggered and this droppable event expects a dragged item but we weren't dragging we were sorting and so "dragModel" is undefined which causes an error and then sorting never happens.
Adding:
to line 64 seems to fix the problem.
Thanks
The text was updated successfully, but these errors were encountered: