锚点在 mootools 中不起作用
我使用 mootools sortables 创建了一个表来实现拖放功能。 在我的表格中,某些列有超链接和文本框。当我单击超链接/输入框时,它总是调用 Sortable 的回调,例如 onComplete。
如何使超链接/输入元素在 Sortable 中工作。我尝试使用 Sortable 的句柄属性,但此属性的问题是它只需要一个元素。如果我必须使用行的多列作为句柄,那么我需要什么该怎么办?我还有希望吗?
提前致谢。
I have created a table using mootools sortables to implement drag and drop functionality.
Inside my table some of the columns has hyperlink and textboxes.When I click on hyperlink/input box it always calls Sortable's callback like onComplete.
How do I make hyperlink/input Elements working inside Sortable.I have tried to use handle property of Sortable but problem with this property is that it takes only one element.If I have to use multiple columns of of row as handle then what I need to do ?Do I have any hope ?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
事实并非如此,您只能使用一个元素作为句柄。您可以使用
handle
选项中的 CSS 选择器来指定句柄。然后,这指的是相对于“可排序”(要排序的元素)。因此,假设在您的可排序项(如
html 元素)中,您的句柄是一个
,其类为
my-handle
,你可以这样做:我认为这样解决它更简洁,而不是停止你一开始不想要的事件的事件传播。
It's not true you can only use one element as a handle. You can specify a handle by using CSS selectors in the
handle
option. This then refers relative to the 'sortable' (the element to be sorted).So suppose within your sortable item (like an
<li>
html element) your handle is a<span>
with the classmy-handle
, you could do:I think it's neater to solve it like that, instead of stopping event propagation of events you didn't want in the first place.
我通过在 domready 中添加以下代码来防止事件冒泡来解决该问题。
I was able to solve the problem by adding following code in domready to prevent event bubbling.