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

How to preserve the original one when drag an item from one grid to another? #661

Closed
shijistar opened this issue May 11, 2017 · 9 comments
Closed

Comments

@shijistar
Copy link

Lets see this official sample: http://troolee.github.io/gridstack.js/demo/two.html
I want to know if it's possible to preserve the original item when we drag one from left grid to the right? i.e. copy from left to right. I didn't see it from api options.
It's really important to me. Any help is so much appreciated! Thanks.

@radiolips
Copy link
Member

Hi, @shijistar ! Preserving the original widget isn't currently possible. However, due to an overwhelming request for it, we plan on adding it very soon. #133 has some requests for this feature as well.

For the time being, you can find upcoming features mentioned in our blog post here. We need to work to figure out what we can move to allow for widget cloning (your request here) to be completed sooner. You can follow the blog, where I'll post gridstack updates. I'll be sure to mention our plan for this and other multiple-grid features.

Thanks for using gridstack.js! Your feedback is important to us - we need this continuous feedback to be sure we're delivering the correct features!

@shijistar
Copy link
Author

Thank you @radiolips for your reply. I'm very happy to hear it's in the plan. I hope it appears in v1.0 :-)

I love gridstack so much, as it provides fantastic user experience that layout the reports like building blocks. Thank you guys for the such wonderful work!

@radiolips
Copy link
Member

@shijistar I've been able to create a working example. As with the multi-grid features, it'll be experimental until everyone has had some time to test it, but it'll be in version 1. Continue to monitor my blog for more information. I'll post in the next few days about how this will work.

This also is requested in #396 #499.

@radiolips radiolips added this to the v1.0.0 milestone May 11, 2017
@mandys
Copy link

mandys commented May 11, 2017

@radiolips i had requested this yesterday as well :) Would you be kind enough to share your solution ?

We are trying to solve it in a round about way ( eg: When the drag start happens we copy the html of the widget into their parent container so while the move is happening a copy of widget is left behind. This isn't the exact jquery clone way. But, imagine it as a pack of cards. When you pick the first one, there is another one below it..We keep doing that..round about..

@radiolips
Copy link
Member

@mandys Sure. For the time being, I am NOT focusing on getting it to work grid-to-grid. If you check the two grid example, there's a widget on the top-left. It's not actually in a grid. That widget will be able to be cloned.

Will that satisfy your requirements? I assume it will - it's actually slightly simpler than needing multiple grids, because I assume that for cloning you don't actually want the initial widget in a grid. Let me know, though.

@mandys
Copy link

mandys commented May 11, 2017

Yes. We don't need the draggables in a grid. They will live in a sidebar and dragged onto the stage (grid).

@radiolips
Copy link
Member

Great. Are you on our Slack? If not, could you join? I could create a patch of the code when I'm done for you to test. If you don't want to, I can push the code to the develop branch when it's complete, but I'd prefer a bit more testers.

@mandys
Copy link

mandys commented May 11, 2017

Just joined

@radiolips
Copy link
Member

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

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

3 participants