本文介绍了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可排序,按钮不能用作句柄
发布评论