jQuery UI-如何正确触发sortupdate事件? [英] jQuery UI - How to trigger sortupdate event properly?

查看:233
本文介绍了jQuery UI-如何正确触发sortupdate事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jQuery v1.8.0和jQuery UI v1.8.22.

I'm using jQuery v1.8.0 and jQuery UI v1.8.22.

文档说,您可以通过以下方式触发sortupdate:

The documentation said that you can trigger sortupdate by:

 $(".selector").bind("sortupdate", function (event, ui) {
     // do something here
 });

 $(".selector").trigger("sortupdate");

但是似乎不是这样,因为ui是未定义的.还有其他方法可以使这项工作/在sortupdate上触发事件吗?

But this doesn't seem to be the case because ui is undefined. Is there any other way to make this work / trigger events on sortupdate?

推荐答案

sortupdate.它应该自动发生,并且不应以任何其他方式触发".并不是说您无法触发该事件,但是,如果不将其传递给'ui',那么它将是不确定的.

sortupdate is triggered once sorting has stopped and the DOM has changed. It should happen automatically and is not intended to be 'triggered' in any other way. That's not to say you can't trigger the event, however, if you don't pass it 'ui', then it'll be undefined.

当sortable触发事件时,不会取消定义ui.

When the sortable triggers the event, ui will not be undefined.

这篇关于jQuery UI-如何正确触发sortupdate事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆