Skip to content

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

Closed

Description

@shijistar

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.

Activity

  1. radiolips commented on May 11, 2017

    @radiolips
    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!

  2. shijistar commented on May 11, 2017

    @shijistar
    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!

  3. radiolips commented on May 11, 2017

    @radiolips
    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.

  4. added this to the v1.0.0 milestone on May 11, 2017
  5. mandys commented on May 11, 2017

    @mandys

    @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..

  6. radiolips commented on May 11, 2017

    @radiolips
    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.

  7. mandys commented on May 11, 2017

    @mandys

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

  8. radiolips commented on May 11, 2017

    @radiolips
    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.

  9. mandys commented on May 11, 2017

    @mandys

    Just joined

  10. radiolips commented on May 15, 2017

    @radiolips
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions