angular-ui / ui-sortable

jQuery UI Sortable for AngularJS
http://angular-ui.github.io/ui-sortable/
MIT License
1.26k stars 444 forks source link

create new parent element when dragging child element #562

Open pranjalpjoshi opened 5 years ago

pranjalpjoshi commented 5 years ago

I am creating a two dimensional structure. For example: Row 0: a,b,c Row 1: x, y, z

There are 3 things i want to accomplish:

  1. Move column elements within same row, example: move element a anywhere in Row 0.
  2. Move column elements in multiple rows, example: move element a anywhere in Row 1.
  3. When moving column element to the top of first row, or below last row, or within rows, add ability to create new Row element having dragged column as the child element, example: when moving element 'a' below Row 1, show placeholder below Row 1 to create Row 2 with element a. expected: Row 0: b,c Row 1: x,y,z Row 2: a I am able to accomplish pt. 1 and pt. 2, wanted to check if pt. 3 was possible.

Here is the link to the codepen: https://codepen.io/anon/pen/vwqgBe?editors=1010