Like dragging Div to another column?

Asked

Viewed 214 times

1

In the Below image, I have several columns where the user can drag the div and put it in another column, as illustrated in the image:

inserir a descrição da imagem aqui

I’m using Sortable of Jquery-UI. I can drag this div to the other column without major problems with the code below:

  <script src="https://code.jquery.com/ui/1.12.0/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#sortable1, #sortable2" ).sortable({
      connectWith: ".connectedSortable"
    }).disableSelection();
  } );
  </script>

I would like to continue this information in the database, that is, when the user returned to the page divs would be in the place he left.

Can someone help me in how to do?

  • Update the database to create and change are action is to use ajax, but there is already download plugin has q search "drag" and do not remember the right name.

  • this is called drag and drop, I can drag normally, however I would like when drag, I update the database.

  • I get it, if you’ve done drag and drop, use div + bind + onchange to work and write action, if you can post your code we can help.

  • I posted them all, there was one missing there?

  • But this used PHP? poste http://www.phpfiddle.org (Note: no php tags?)

  • Yeah, I didn’t update the database, just the part that drags the business to div next door... so everything I did, it’s here.

  • @Andrébaill is practically this Fiddle, you only have to adapt it. https://jsfiddle.net/k0owpLLx/

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.