jQuery UI可排序,按钮不能用作句柄

编程入门 行业动态 更新时间:2024-10-28 21:25:01
本文介绍了jQuery UI可排序,按钮不能用作句柄的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试对表中的tr's进行排序.

I am trying to sort tr's in a table.

代码

$("table tbody").sortable({ handle: 'button' //handle: 'img' }).disableSelection();

小提琴

现在的问题是使用img作为其正常工作时

now the problem is when using img as handle its working fine

但是当使用button作为句柄时,它不起作用

but when using button as handle its not working

我检查了许多jquery ui可排序查询,但没有帮助

I checked for many jquery ui sortable ques for my ans but of no help

任何人都可以解释为什么会发生这种情况

can anyone plz explain why is this happening

先感谢

推荐答案

cancel选项默认为:input,button,与您的手柄设置冲突.只需将其设置为空字符串即可.

The cancel option defaults to :input,button which conflicts with your handle setting. Just setting it to an empty string works fine.

$("table tbody").sortable({ handle: 'button', cancel: '' })

jsfiddle/22C2n/705/

更多推荐

jQuery UI可排序,按钮不能用作句柄

本文发布于:2023-11-13 21:10:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585327.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:句柄   按钮   jQuery   UI

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!