-
Notifications
You must be signed in to change notification settings - Fork 573
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
Drag drop with helper clone and insertInline messes up the dropped array? #305
Comments
@phuwin You are doing it wrong. Pls refer, https://github.com/codef0rmer/angular-dragdrop/blob/master/demo/dnd-shoppingcart.html |
@codef0rmer Can you point which are the wrong lines of code? |
@phuwin AFAIK, your demo is quite similar to the shopping cart demo I shared earlier. Please refer to it because |
@codef0rmer I still need the insertInline because I need the end array to be sortable. |
You do not need to use `insertInline` in order to sort the array, that's
not why the feature was introduced. The `insertInline` is like sortable in
jqueryUI.
For the sorting functionality, you can sort the array upfront and use it in
ngRepeat then, refer filters demo for that:
https://github.com/codef0rmer/angular-dragdrop/blob/master/demo/dnd-filters.html
…On Thu, Dec 8, 2016 at 1:35 PM, Phu Nguyen ***@***.***> wrote:
@codef0rmer <https://github.com/codef0rmer> I still need the insertInline
because I need the end array to be sortable.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#305 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKNO3QQvWYQmFTbTkrryu0TCwbXYeGlks5rF7pcgaJpZM4LGlpQ>
.
--
*With Regards,*
*Amit Gharat*
http://amitgharat.wordpress.com/
*The luckiest person is one whose passion and profession are the same.*
|
@codef0rmer Maybe there is a misunderstanding.
|
@codef0rmer The issue I have at the moment is that after the first item dropped, the later items mess up the end array. Sortable function works well though. |
@codef0rmer Hi there, I also got this similar issue here. here is the plunker url https://plnkr.co/edit/lTwpnTdLHtlnhTE1EaLm, function try to achieve: In shopping cart panel, let's say it already has 1.lolcat shirt & 2.cheezeburger shirt, I want to be able to drag buckit shirt directly from the product panel to the cart panel, the result in the cart panel should have 1.lolcat shirt 2.buckit shirt 3.cheezeburger shirt. As the plunker url showing, once I drag the buckit shirt from product panel and drop onto cheezeburger shirt which already in the cart panel, everything just mess up, it turns out the result showing 1.lolcat shirt 2.buckit shirt 3.buckit shirt Please help, thanks! |
@phuwin have you solved the issue you got now, seems I got the same issue at the moment. |
Quick glance: http://g.recordit.co/GOL1YK5LR8.gif
I create a snippet with clone helper and insertInline to sort the items in the "droppable" area.
After dropping an item into the droppable area, it messed up the end array (changes them completely). I have no clue what causes this...
The text was updated successfully, but these errors were encountered: