Skip to content
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

Clone node on drop #396

Closed
notbear opened this issue Mar 10, 2016 · 16 comments
Closed

Clone node on drop #396

notbear opened this issue Mar 10, 2016 · 16 comments

Comments

@notbear
Copy link

notbear commented Mar 10, 2016

I'm trying to make an application where items can be copied from the palette to the canvas. For now gridpack supports only moving between grids. I hoped that it would be enough to remove line 785 from v0.2.5 which removes the source of element, but it leads to undesired behaviors when I try to copy the element from palette into canvas two or more times.

Example: http://codepen.io/NotBear/pen/EKyYqB/

Please advice

@troolee
Copy link
Member

troolee commented Mar 10, 2016

Try to unbind all events handlers and data attributes of cloned item

@notbear
Copy link
Author

notbear commented Mar 10, 2016

Thanks, I will try and let you know.

@kertonandrew
Copy link

kertonandrew commented May 1, 2016

Did you find a solution to the problem?

Edit: I'm cloning widgets from a palette similar to your example. After dropping a widget in my gridstack container the next widget I grab from the palette triggers an "out" event although it has never entered the droppable area. This occurs in your example too. I'm a bit of a js noob so not exactly sure why these events are occuring. Would greatly appreciate any pointers, I'll post my solution once I figure it out.

@notbear
Copy link
Author

notbear commented May 3, 2016

@attractivePoop I'm sorry, but not. My team resigned from gridstack due to changed requirements.

@kertonandrew
Copy link

Thank you for the response.

@mcelligottnick
Copy link

@troolee @attractivePoop I have solved this with a faux clone implmentation - https://gist.github.com/mcelligottnick/2d17a65615eb54b1c744050cb31ed028

@redstubble
Copy link

@troolee I am hitting this same issue. I have tried to unbind all attributes and events to no avail can you provide a snippet to point me in the right direction.

@radiolips
Copy link
Member

We'll take a look at adding this ability into v.0.2.7 so that no hacky workaround will be required

@ValentinFunk
Copy link

Also looking for this, has anyone found a workaround for this?

@nelsonad
Copy link

nelsonad commented Oct 19, 2016

Hey all, I ran into this issue too and posted my fix before I saw this issue.

#542

Edit! My fix addresses the issue @attractivePoop was seeing with "out" triggering before "over"

@AurelDragut
Copy link

Guys, what do you think about reloading the source grid's content on drag start?

@radiolips
Copy link
Member

This will be available in some form or another in v1.0.0. Please check my blog for more information. I'll post in the next few days about how this will work.

@radiolips
Copy link
Member

This works on the develop branch now. Please be sure to use draggable setting helper: clone.

@tanobi92
Copy link

Hi @radiolips , I tried to use setting helper: clone for draggable in example two.html, but failed. I downloaded new version 1.0.0. Help me! Thanks!

@abayob
Copy link

abayob commented May 26, 2017

@tanobi92 It works fine here! What is your code, how are you using it? What do you expect should happen?

@tanobi92
Copy link

tanobi92 commented May 26, 2017

Oh @radiolips , @abayob , I use file gridstack.all.js in folder "dist" when it runs, and I use gridstack.js when it fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests