我正在我的一个表上使用可选择的jquery,我希望在某些情况下从元素中删除.selectable。
我找到了一个可行的解决方案,那就是添加禁用true或false的选项,并在if和else语句中使用该选项。
$( ".standard-table").selectable({
filter: "tr",
disabled: false,
scrollSnapX: 5, // When the selection is that pixels near to the top/bottom edges, start to scroll
scrollSnapY: 5, // When the selection is that pixels near to the side edges, start to scroll
scrollAmount: 25, // In pixels
scrollIntervalTime: 100 // In milliseconds
});但是,我希望jquery可以选择,这样我就可以以其他方式与表交互,这是有缺点的。
当我禁用可选择的Jquery时,它做的工作是不像我想要的那样选择表,但它防止我在禁用Jquery时触发表上的任何事件。
我想,与其添加禁用选项,不如在我喜欢的时候从.standard-table中删除.standard-table,并在我喜欢的时候将它放回去。
这个是可能的吗?或者还有别的办法可以绕过它?
发布于 2015-07-24 11:30:41
可以使用破坏方法删除可选择的
$( ".standard-table" ).selectable( "destroy" );https://stackoverflow.com/questions/31609327
复制相似问题