3

I have a list that needs to be draggable. For simplicity lets have the items only be "boy" and "girl". I have another list "friends" that you can drag "boy" and "girl" into then set properties such as name, age, height, etc. This list also needs to be sortable (drag and drop).

Basically I want to add items to the "friends" list by dragging in either a "boy" or "girl" but I'm not sure how to get the two lists to interact using knockout.

Nal
  • 2,741
  • 20
  • 14
user1630508
  • 91
  • 2
  • 5
  • Sortable `connectWith` option? Or are you asking how to use knockout? – Nal Sep 05 '12 at 03:18
  • I had it 90% there using pure jQuery but realized I needed knockout too because observables were not being created. Using the two together is stumping me. – user1630508 Sep 05 '12 at 13:13

1 Answers1

8

Ryan Niemeyer has written great article about dragging and dropping with knockout:

http://www.knockmeout.net/2011/05/dragging-dropping-and-sorting-with.html

Ryan Niemeyer has authored a Knockout plug-in for this purpose:

Here is an updated blog entry:

Jim G.
  • 15,141
  • 22
  • 103
  • 166
Artem Vyshniakov
  • 16,355
  • 3
  • 43
  • 47
  • Thanks. I saw that. In my scenario, I'm getting hung up because I'm not actually moving boy or girl. I just want to drag them into the list to create a new instance of them. – user1630508 Sep 05 '12 at 13:11
  • 1
    ooh thanks! Anyone know of a repo/master list of KO plugins? Could have used this at beginning of my sprint :) – Morgan T. Mar 08 '13 at 19:13