简体   繁体   English

动态添加元素,可拖动和可排序

[英]dynamic add elements, dragable and sortable

Hi I am having a hard time doing my fiddle here 嗨,我在这里做琴很困难
what I like to do is: 我想做的是:

1. Dynamic Add group 1.动态添加组
2. Dynamic Add question 2.动态添加问题
3. Sortable Group 3.可排序的组
4. Sortable Question 4.可排序问题
5. Question can be drop to another group 5.问题可以放到另一个小组

but the fiddle does only : 但是小提琴只能:

1. Dynamic Add group 1.动态添加组
2. Dynamic Add question 2.动态添加问题
4. Sortable Question 4.可排序问题

also the generated input is disabled how is that? 也禁用了生成的输入,那是怎么回事?

could anyone help me please? 有人可以帮我吗? I'm a backend guy so please spare me. 我是一个后端人,所以请饶恕我。

thank you in advance. 先感谢您。

for the disabled inputs, you could try removing the '.disableSelection()' codes. 对于禁用的输入,您可以尝试删除“ .disableSelection()”代码。


Here is an updated version of the fiddle : link . 这是fiddle的更新版本: link What I did was: 我所做的是:

Removed all of the disableSelection() codes. 删除了所有的disableSelection()代码。 Created a common sortable container and attached all the sortable in the classes. 创建一个通用的可排序容器,并在类中附加所有可排序对象。 This way, multiple questions can be transferred from one container to the other. 这样,可以将多个questions从一个容器转移到另一个容器。 Added a min-height property to the containers. 向容器添加了min-height属性。 You need this height to add an element back to the main container. 您需要此高度才能将元素添加回主容器。

Hope this helps pards! 希望这对大家有所帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM