gpt4 book ai didi

jquery - 当用户尝试对数据进行排序时显示加载微调器

转载 作者:行者123 更新时间:2023-12-01 03:48:44 27 4
gpt4 key购买 nike

我需要帮助修改我的 jquery tablesorter 插件。

我正在使用位于 http://tablesorter.com/docs/ 的插件

<script type="text/javascript">
$(document).ready(function() {
$('table').tablesorter({
});
});
</script>

我得到了用户的帮助,现在工作正常。由于我有大量数据需要排序,所以速度有点慢。

因此,当用户单击它时,我希望用户知道它正在尝试对数据进行排序。所以我想要一个提示或在执行排序时显示“正在加载”或“正在排序”或一个忙碌符号的提示有人可以帮我吗?

最佳答案

来自the documentation :

$(document).ready(function() { 
// call the tablesorter plugin, the magic happens in the markup
$("table").tablesorter();
//assign the sortStart event
$("table").bind("sortStart",function() {
$("#overlay").show();
}).bind("sortEnd",function() {
$("#overlay").hide();
});
});

说明:插件实现了两个回调 Hook - sortStartsortEnd。因此,用人类语言来说,上面的代码意味着在排序开始之前显示叠加层,并在排序完成后立即隐藏它

关于jquery - 当用户尝试对数据进行排序时显示加载微调器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10854720/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com