Jquery UI 可排序克隆“不工作”

发布于 2024-09-06 20:08:32 字数 604 浏览 3 评论 0原文

希望你能帮助解决这个问题(甚至改进它 - 这并不困难!)

我正在使用 UI 可排序和选项卡。我能做的就是从一列拖放到另一列并操作数组以将其序列化。

简而言之,我有 2 列。 “col_a”和“col_b”。 col_a 有 2 个选项卡项目。可以从 col_a 移动到 col_b,但如果您从 col_b“返回”到 col_a,我希望可拖动项仅返回到它的“父”选项卡(如果您理解该选项卡)。

这确实是我想做的,或者只将可拖动的克隆从 col_a 拖动到 col_b,将原始内容保留在 col_a 中。然后以某种方式(尚未确定最好的方法)“销毁”col_b 中的可拖动对象(如果它们“返回”到 col_a)。

$j(function() {
$j("#col_a,#col_b").sortable({
connectWith: '.column',
helper: 'clone'         
stop : function () {
var result = $j('#col_b').sortable('toArray');
}
$j(".column").disableSelection();
});

col_a 和 col_b 都有 CSS 类 .column

hope you can help with this one (or even improve it - which won't be difficult!)

I am using UI sortables and tabs. What I can do is drag drop from column to column and manipulate the array/s to serialize it/them.

In short I have 2 cols. "col_a" and "col_b". col_a has 2 tabs Items. Can move from col_a to col_b but if you move "back" from col_b to col_a I want the draggable to ONLY go back into it's "parent" tab if you understand that one.

That is really what I would like to do OR only drag a clone of the draggable from col_a to col_b leaving the original in col_a. Then somehow (best way not sure yet) to "destroy" the draggables in col_b if they are "returned" to col_a.

$j(function() {
$j("#col_a,#col_b").sortable({
connectWith: '.column',
helper: 'clone'         
stop : function () {
var result = $j('#col_b').sortable('toArray');
}
$j(".column").disableSelection();
});

Both col_a and col_b have the CSS class .column

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北座城市 2024-09-13 20:08:32

好吧,我让它工作不使用排序,但使用可拖动和可放置实际上是一个“更好”的解决方案,以达到我的目的。当我完成“代码”后,我会回来编辑/更新这个答案

OK I have it working not using sortables but using draggable and droppable actually a b"better" solution for my purpose. When I have finished the "code" I will come back and edit/update this answer

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文