jQuery UI可排序,按钮不能用作句柄 [英] Jquery UI sortable, button is not working as handle
本文介绍了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: ''
})
http://jsfiddle.net/22C2n/705/
这篇关于jQuery UI可排序,按钮不能用作句柄的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文