jQuery UI可排序和对话 [英] jQuery UI Sortable and Dialogue

查看:91
本文介绍了jQuery UI可排序和对话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将jQuery UI Sortable列表项拖到两个列表之间,其中之一在jQuery UI对话中,而另一个不在jQuery UI对话中?

Is it possible to drag jQuery UI Sortable list items between two lists, one of which is in a jQuery UI Dialogue and one which is not?

我正在尝试创建一个对话框,用户可以在其中将表单字段从对话框中拖出到页面上的表单中,但不能将项目拖出对话框边界.

I am trying to create a dialogue where users can drag form fields out of a dialogue into a form which is on the page, but I can't drag the items out of the dialogue border.

预先感谢

修改

似乎拖放确实有效,但是一旦超出对话范围,您将看不到该项目.这不是很理想. (请参见 redsquare的演示)

It seems that the dragging and droppings is actually working, but you can't see the item once you go beyond the dialogue. This isn't really ideal. (see redsquare's demo)

另一个编辑

为对话框创建的主要div上具有overflow:hidden.如果我在Firebug中禁用了此功能,则拖动工作正常,因此我想我可以以某种方式覆盖此功能,但是我怀疑这会给我带来更多问题.

The main div that gets created for the dialogue has overflow:hidden on it. If I disable this in Firebug the dragging works properly, so I guess I could somehow override this, but I suspect that will cause me more problems.

推荐答案

演示此处.

这是否可以复制您的问题?我可以在两者之间拖动,但是当您拖出或拖到对话框中时,您确实会失去帮助者.我认为当您移出对话框或移入对话框时,可能需要调整z索引,但是它仍然可以正常工作...

Does this replicate your issue? I am able to drag between the two however you do lose the helper when you drag out of or into the dialogue. I think it may need to adjust the z-indexing when you move out or in of the dialog but it is still functional...just!

稍后再尝试排序.

更新:调整z-index会有所帮助(非常有助于第一次将其从列表中拖到对话框中!)...以后会变得更好!请参见此处

UPDATE: tweaking the z-index helps (well helps dragging from the list to the dialogue - the first time!)...will make it better later! see here

新的更新这里的新演示,我必须使用帮助程序来确保z-index保持正确.现在可以在此处

NEW UPDATE New Demo here, I had to make use of the helper to ensure the z-index stayed correct. Works now here

这篇关于jQuery UI可排序和对话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆