Help forum

How to make a div drag and drop for rearrangement?

  • mesmoiron

    2 years ago

    Hi,

    I want to make movable cards that can be move around in a grid like container. In the side menu, items can be moved up and down. I also want the items to move left and right and vise versa, such that the other items move out of the way. Any suggestions?
  • mesmoiron

    2 years ago

    How to make a div drag and drop for rearrangement?
  • Lucas G

    2 years ago

    @Max's drag and drop package might help
    💪1
  • Max

    2 years ago

    I don't fully understand what you are trying to do, but if it is basically a drag and drop list, the Spark Drag and Drop package could be a fit, as @Lucas G mentioned 😊
  • mesmoiron

    2 years ago

    Thank you, that is helpful. I am trying to make a simple dashboard that can arrange the items. Like graphics applications, where you can move the panels around. Move things out of the way.
  • Max

    2 years ago

    If this is in a defined grid or list, it should be doable with the package
  • Lucas G

    2 years ago

    It is possible to do it with native toddle, I did it in the starter pack's dnd list but I didn't go the extra mile of making it mobile friendly, etc
  • Max's package uses sortablejs right? Which is great for that type of thing
  • Max

    2 years ago

    Correct. It is just a wrapper.
  • Alex

    2 years ago

    Does the package go through how to reorder items in a database once dragged??
  • I’ll build it into my directory this week for users to reorder their image gallery if so
  • Lucas G

    2 years ago

    The one I made does give back the new array order and I'm sure Max's package does as well
  • Alex

    2 years ago

    Okay that’s great. I’ll have a play! A neat little feature for my CRM build and for my render directory.

    If I can get it working it’ll be so good
  • Armand

    2 years ago

    Have a look at the explanation vids on the package page. Max explains how it works really well
    😊2
  • mesmoiron

    2 years ago

    For now I have cloned the package, and I am going to step by step recreate it. This will be a huge learning opportunity to sort out advanced techniques with functionality that keeps me motivated and understand how its build up. Thanks.
    💪1