Sortable and droppable knockout list

有些话、适合烂在心里 提交于 2020-01-11 06:50:13

问题


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.


回答1:


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:

  • https://github.com/rniemeyer/knockout-sortable

Here is an updated blog entry:

  • http://www.knockmeout.net/2012/02/revisiting-dragging-dropping-and.html


来源:https://stackoverflow.com/questions/12273818/sortable-and-droppable-knockout-list

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!